| 程序包 | 说明 |
|---|---|
| org.teasoft.bee.osql |
面向对象SQL相关.Function about Object SQL.
|
| org.teasoft.bee.osql.service |
service层相关服务的类与接口.Interface and class about service layer.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Condition |
Condition.and()
默认自动加 'and'.Default will automatically add 'and'.
|
Condition |
Condition.between(String field,
Number low,
Number high) |
Condition |
Condition.between(String field,
String low,
String high) |
Condition |
Condition.forUpdate()
锁定查询的部分记录(仅用于SQL的单个表select)
|
Condition |
Condition.groupBy(String field) |
Condition |
Condition.having(FunctionType functionType,
String field,
Op Op,
Number value)
eg: having(FunctionType.MIN, "field", Op.ge, 60)-->having min(field)>=60
|
Condition |
Condition.having(String expressionStr)
eg:having("count(*)>5") --> having count(*)>5
|
Condition |
Condition.lParentheses()
添加左括号.Add left parentheses.
|
Condition |
Condition.notBetween(String field,
Number low,
Number high) |
Condition |
Condition.notBetween(String field,
String low,
String high) |
Condition |
Condition.op(String field,
Op Op,
Object value)
添加一个表达式条件.Add a expression condition.
|
Condition |
Condition.or()
添加 'or'.Add 'or'.
|
Condition |
Condition.orderBy(FunctionType functionType,
String field,
OrderType orderType)
eg: orderBy(FunctionType.MAX, "total", OrderType.DESC)-->order by max(total) desc
|
Condition |
Condition.orderBy(String field)
eg: orderBy("price")-->order by price
|
Condition |
Condition.orderBy(String field,
OrderType orderType)
eg: orderBy("price", OrderType.DESC)-->order by price desc
|
Condition |
Condition.rParentheses()
添加右括号.Add right parentheses.
|
Condition |
Condition.selectField(String fieldList)
指定需要查询的部分字段(仅用于SQL的select).Specify the partial fields to be queried (only for select of SQL).
|
Condition |
Condition.set(String fieldNmae,
Number num)
设置需要更新的字段(仅用于SQL的update);当要更新的字段也需要用于where条件时,可用该方法
Set the fields that need to be updated (only for update of SQL ); this method can be used when the set fields also need to be used for the where expression. |
Condition |
Condition.set(String fieldNmae,
String value)
设置需要更新的字段(仅用于SQL的update);当要更新的字段也需要用于where条件时,可用该方法
Set the fields that need to be updated (only for update of SQL); this method can be used when the set fields also need to be used for the where expression. |
Condition |
Condition.setAdd(String field,
Number num)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
Condition.setAdd(String field,
String fieldName)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
Condition.setIncludeType(IncludeType includeType)
设置IncludeType过滤参数.op,between,notBetween方法设置的字段,不受includeType的值影响.Set IncludeType.
|
Condition |
Condition.setMultiply(String field,
Number num)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
Condition.setMultiply(String field,
String fieldName)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
Condition.size(Integer size)
添加用于分页时设置每页返回的记录数量(仅用于SQL的select).For setting the size of the page(only for select of SQL).
|
Condition |
Condition.start(Integer start)
添加用于分页时设置开始的页数(仅用于SQL的select).For setting the start of the page(only for select of SQL).
|
| 限定符和类型 | 方法和说明 |
|---|---|
<T> int |
Suid.delete(T entity,
Condition condition)
根据实体对象和Condition删记录.Delete the records according to entity and condition.
|
<T> List<T> |
Suid.select(T entity,
Condition condition)
根据实体对象和Condition查询数据.Select the records according to entity and condition.
|
<T> List<T> |
MoreTable.select(T entity,
Condition condition)
根据实体对象和Condition查询数据.Select the records according to entity and condition.
|
<T> List<T> |
SuidRich.select(T entity,
IncludeType includeType,
Condition condition)
已过时。
Suid.select(Object,Condition)方法中,可以通过condition设置includeType. |
<T> String |
SuidRich.selectJson(T entity,
IncludeType includeType,
Condition condition)
根据实体对象entity查询数据,并以Json格式返回
Select and return data in Json format according to entity object. |
<T> String |
ObjToSQL.toDeleteSQL(T entity,
Condition condition)
根据entity和Condition转换成sql语句
|
<T> String |
ObjToSQL.toSelectSQL(T entity,
Condition condition)
根据entity和Condition转换成sql语句
|
<T> String |
MoreObjToSQL.toSelectSQL(T entity,
Condition condition)
根据entity和Condition转换成sql语句
|
<T> String |
ObjToSQLRich.toSelectSQL(T entity,
IncludeType includeType,
Condition condition) |
<T> String |
ObjToSQLRich.toUpdateBySQL(T entity,
String whereFields,
Condition condition) |
<T> String |
ObjToSQLRich.toUpdateSQL(T entity,
String updateFields,
Condition condition) |
<T> int |
SuidRich.update(T entity,
Condition condition)
当SQL update的set表达式通过Condition定义时,可以不用再指定set使用的字段.
|
<T> int |
SuidRich.update(T entity,
String updateFields,
Condition condition)
更新记录,且可以指定需要更新的字段,高级条件可通过Condition参数设置.Update record, can list update fields.
|
<T> int |
SuidRich.updateBy(T entity,
String whereFields,
Condition condition)
更新记录,且可以指定作为条件的字段.Update record according to whereFields.
|
| 限定符和类型 | 方法和说明 |
|---|---|
<T> int |
ObjSQLAbstractServiceImpl.delete(T entity,
Condition condition) |
<T> List<T> |
ObjSQLAbstractServiceImpl.select(T entity,
Condition condition) |
<T> List<T> |
ObjSQLRichAbstractServiceImpl.select(T entity,
IncludeType includeType,
Condition condition) |
<T> String |
ObjSQLRichAbstractServiceImpl.selectJson(T entity,
IncludeType includeType,
Condition condition) |
<T> int |
ObjSQLRichAbstractServiceImpl.update(T entity,
Condition condition) |
<T> int |
ObjSQLRichAbstractServiceImpl.update(T entity,
String updateFields,
Condition condition) |
<T> int |
ObjSQLRichAbstractServiceImpl.updateBy(T entity,
String whereFields,
Condition condition) |
Copyright © 2020. All rights reserved.