public interface MoreTable
example:
public class Orders{
private Long id;
private String userid;
private String name;
private BigDecimal total;
private Timestamp createtime;
private String remark;
private String sequence;
@JoinTable(mainField="userid", subField="name")
private User user;
// ... get,set methods.
}
public class User {
private Integer id;
private String email;
private String lastName;
private String name;
private String password;
private String username;
// ... get,set methods.
}
public class MoreTableExam {
public static void main(String[] args) {
MoreTable moreTable=BeeFactory.getHoneyFactory().getMoreTable();
Orders orders1=new Orders();
orders1.setUserid("Bee");
User user=new User();
user.setEmail("beeUser@163.com");
orders1.setUser(user);
List //... process list1
}
}
| 限定符和类型 | 方法和说明 |
|---|---|
<T> List<T> |
select(T entity)
根据实体对象entity查询数据
According to entity object select records from database.
|
<T> List<T> |
select(T entity,
Condition condition)
根据实体对象和Condition查询数据.select the records according to entity and condition.
|
<T> List<T> |
select(T entity,
int start,
int size)
根据实体对象entity查询数据
According to entity object select records from database.
|
<T> List<T> select(T entity)
entity - 与表对应的实体对象,且不能为空. table's entity(do not allow null).
entity中非null且非空字符串作为过虑条件,操作符是等号.eg:field=value
entity corresponding to table and can not be null.
If the field value is not null and not empty string as filter condition,
the operator is equal sign.eg:field=value<T> List<T> select(T entity, int start, int size)
entity - 实体类对象,且不能为空. table's entity(do not allow null).
entity中非null且非空字符串作为过虑条件,操作符是等号.eg:field=value
entity corresponding to table and can not be null.
If the field value is not null and not empty string as filter condition,
the operator is equal sign.eg:field=valuestart - 开始下标(从0或1开始,eg:MySQL是0,Oracle是1). start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - 结果集大小 大于等于1. fetch result size (>0).<T> List<T> select(T entity, Condition condition)
entity - 与表对应的实体对象,且不能为空. table's entity(do not allow null).condition - 默认有值的字段会转成field=value的形式,其它形式可通过condition指定.condition使用过的字段,默认情况不会再处理.
if the field is not null or empty, it will be translate to field=value.Other can define with condition.
若condition没有设置IncludeType,默认过滤NULL和空字符串(但condition中op,between,notBetween方法设置的字段,不受includeType的值影响.)Copyright © 2020. All rights reserved.