public class NutPojo extends NutStatement implements Pojo
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<PItem> |
items
供子类访问的语句元素
|
expert| Constructor and Description |
|---|
NutPojo() |
| Modifier and Type | Method and Description |
|---|---|
Pojo |
addParamsBy(Object obj)
通过普通Java对象为这个 POJO 语句的 SQL 参数赋值
一个 POJO 实际上是一个 SQL 的语句模板,增加一个 Java 对象,实际上就是增加了一组参数 因此如果你想为 POJO 里附加一个集合或者数组对象,对象必须是同样类型的,否则会出现不可预知的错误 |
Pojo |
append(PItem... itemAry)
为POJO语句增加一个或多个语句元素
|
Pojo |
clear()
清除已经存储的对象
|
Pojo |
duplicate()
复制一份自己的实例
|
ValueAdaptor[] |
getAdaptors()
为本语句每一个参数提供一个适配器
|
PItem |
getItem(int index)
获取 POJO 的一个语句元素
|
Object |
getLastParams() |
Object |
getOperatingObject()
一个 Pojo 语句正在操作的对象,就是你通过 Dao 接口传入的对象本身。
|
Object[][] |
getParamMatrix()
用一个矩阵描述语句的参数表。
这个参数矩阵将同 getAdaptors() 的返回组合使用 |
Pojo |
insertFirst(PItem... itemAry)
在 POJO 所有的语句前插入一组语句元素
|
void |
onAfter(Connection conn,
ResultSet rs,
Statement stmt)
语句执行完毕的后续操作
|
void |
onBefore(Connection conn)
语句执行之前的操作
|
List<Object> |
params()
返回语句的参数表。
|
Pojo |
removeItem(int index)
删除 POJO 的一个语句元素
|
Pojo |
setAfter(PojoCallback after)
设置语句执行后的操作
|
Pojo |
setBefore(PojoCallback before)
设置语句执行前的操作
|
Pojo |
setItem(int index,
PItem pi)
置换 POJO 的一个语句元素
|
Pojo |
setOperatingObject(Object obj)
设置一个 POJO 正在操作的对象
|
Pojo |
setPager(Pager pager)
为 POJO 语句设置分页对象
|
NutPojo |
setSqlType(SqlType sqlType) |
String |
toPreparedStatement()
将 Dao 语句转换为 JDBC SQL 缓冲语句
|
String |
toString()
输出打印字符串
|
forceExecQuery, forPrint, getAdapterBy, getBoolean, getContext, getDouble, getDouble, getEntity, getFloat, getFloat, getInt, getInt, getList, getLong, getLong, getNumber, getObject, getResult, getSqlType, getString, getUpdateCount, isAlter, isCall, isCreate, isDelete, isDrop, isExec, isForceExecQuery, isInsert, isOther, isRun, isSelect, isUpdate, param2String, setContext, setEntity, setExpert, toExampleStatement, toStatementclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforceExecQuery, forPrint, getBoolean, getContext, getDouble, getDouble, getEntity, getFloat, getFloat, getInt, getInt, getList, getLong, getLong, getNumber, getObject, getResult, getSqlType, getString, getUpdateCount, isAlter, isCall, isCreate, isDelete, isDrop, isExec, isForceExecQuery, isInsert, isOther, isRun, isSelect, isUpdate, setEntity, setExpertpublic ValueAdaptor[] getAdaptors()
DaoStatementgetAdaptors in interface DaoStatementpublic Object[][] getParamMatrix()
DaoStatement矩阵的每一行相当于执行一条语句
参数表的下标意义为: Object[行][列]
getParamMatrix in interface DaoStatementpublic String toPreparedStatement()
DaoStatementtoPreparedStatement in interface DaoStatementpublic void onBefore(Connection conn) throws SQLException
DaoStatement这个接口函数你基本不会直接使用的
onBefore in interface DaoStatementconn - 当前执行语句的连接SQLExceptionpublic void onAfter(Connection conn, ResultSet rs, Statement stmt) throws SQLException
DaoStatement这个接口函数你基本不会直接使用的
onAfter in interface DaoStatementconn - 当前执行语句的连接rs - 当前语句执行的结果集stmt - TODOSQLException - 回调函数抛出的异常public Pojo setBefore(PojoCallback before)
Pojopublic Pojo setAfter(PojoCallback after)
Pojopublic Pojo setPager(Pager pager)
PojosetPager in interface DaoStatementsetPager in interface Pojopager - 分页对象public Pojo addParamsBy(Object obj)
Pojo接口的实现类会根据你给出的对象类型不同,对你的对象做不同的解释,它考虑的方式为:
注意:
某些 SQL 语句(比如 CREATE|DROP)即使有参数,也是没有意义的,所以 Pojo 执行器会忽略它们
addParamsBy in interface Pojoobj - 普通 Java 对象Pojo.addParamsBy(Object)public Object getLastParams()
getLastParams in interface Pojopublic Object getOperatingObject()
PojogetOperatingObject in interface Pojopublic Pojo setOperatingObject(Object obj)
PojosetOperatingObject in interface Pojoobj - 正在操作的对象public Pojo append(PItem... itemAry)
Pojopublic Pojo insertFirst(PItem... itemAry)
PojoinsertFirst in interface PojoitemAry - 语句元素public Pojo setItem(int index, PItem pi)
Pojopublic Pojo removeItem(int index)
PojoremoveItem in interface Pojoindex - 位置下标public NutPojo setSqlType(SqlType sqlType)
setSqlType in class NutStatementpublic String toString()
DaoStatementtoString in interface DaoStatementtoString in class NutStatementCopyright © 2017. All rights reserved.