`
文章列表

ibatis连接查询

本例子连接tb_account,tb_order,tb_orderItem三张表进行连接查询。 Account.java代码如下: package com.ibatis.chap6.test; import java.util.List; public class Account { /* 用户id */ private int id ; /* 用户名*/ private String name ; /* 和该用户关联的订单*/ private List<Order> orderList; public int getId() ...
AbstractMediator.java代码如下: package com.designPattern.mediator; public abstract class AbstractMediator { protected Purchase purchase; protected Sale sale; protected Stock stock; public AbstractMediator(){ purchase = new Purchase(this); sale = new Sale(this); stock = new Stoc ...
AdvTemplate.java代码如下: package com.designPattern.prototype; public class AdvTemplate { private String advSubject = "title"; private String advContext = "context"; public String getAdvSubject() { return advSubject; } public String getAdvContext() { retu ...
LiftState.java代码如下: package com.designPattern.state; public abstract class LiftState { protected Context context; public abstract void open(); public abstract void close(); public abstract void run(); public abstract void stop(); public Context getContext() { r ...
IVisitor.java代码如下: package com.designPattern.visitor; public interface IVisitor { public void visit(CommonEmployee commonEmployee); public void visit(Manager manager); } Visitor.java代码如下: package com.designPattern.visitor; public class Visitor implements IVisitor{ @Overr ...
这里采用两种方式实现观察者模式:第一种方式为完全自己写,第二种方式为实现JDK 的Observable和Observer接口 第一种方式: Observer.java代码如下: package com.designPattern.abserver; public interface Observer { public void update(String context); } LiSi.java代码如下: package com.designPattern.abserver; public class LiSi impleme ...
该设计模式是以公司的组织结构为背景的 Crop.java代码如下: package com.designPattern.composite; public abstract class Corp { private String name =""; private String position = ""; private int salary = 0; public Corp(String name,String position,int salary){ this.name = name; ...
IProject.java代码如下: package com.designPattern.iterator; public interface IProject { public void add(String name,int num,int cost); public String getProjectInfo(); public IProjectIterator iterator(); } Project.java代码如下: package com.designPattern.iterator; import java.u ...
将”壹拾叁亿零壹“转换为”1300000001“的代码 代码如下: package com.moneyTransfer.Test; /** * * @author yangjianzhou * 在0---9999亿的范围内的转换 */ public class ChineseToDigital { private static final String data = "壹贰叁肆伍陆柒捌玖"; private static final String units = "拾佰仟"; public st ...
将数字“123456789”转换为“壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元“的代码: 代码如下: package com.moneyTransfer.Test; public class RMB { private static final char[] data = new char[]{ '零','壹','贰','叁','肆','伍','陆','柒','捌','玖'}; private static final char[] units = new char[]{ '元','拾','佰','仟','万','拾','佰','仟','亿','拾','佰', ...
Group.java代码如下: package com.designPattern.command; /** * * @author yangjianzhou * 项目组分成了三个组,每个组都要接受增删改的命令 */ public abstract class Group { public abstract void find(); public abstract void add(); public abstract voi ...
SchoolReport.java代码如下: package com.designPattern.decorator; public abstract class SchoolReport { public abstract void report(); public abstract void sign(String name); } FouthGradeSchoolReport.java代码如下: package com.designPattern.decorator; public class FouthGradeSchoolReport ...
Product.java代码如下: package com.designPattern.bridge; /** * * @author yangjianzhou * 这是整个集团公司的产品类 */ public abstract class Product { public abstract void beProducted(); public abstract void beSelled(); } House.java代码如下: package com.designPattern.bridge; public class ...
CarModel.java代码如下: package com.designPattern.builder; import java.util.ArrayList; public abstract class CarModel { private ArrayList<String> sequence = new ArrayList<String>(); protected abstract void start(); protected abstract void stop(); protected abstract ...
HummerModel.java代码如下: package com.designPattern.templateMethod; public abstract class HummerModel { protected abstract void start(); protected abstract void stop(); protected abstract void alarm(); protected abstract void engineBoom(); /** * 这就是模板方法:run()定义了其他方法的顺序, ...
Global site tag (gtag.js) - Google Analytics