后台数据库操作方法(private端):
//只能在private端使用
BaseDAO bd = new BaseDAO();
//查询语句只能返回一行一列结果
String sql="select vbillcode from conn_user where pk_user='pk'";
Object result = bd.executeQuery(sql, new ColumnProcessor());
//查询语句可以返回多行多列
String sql="select * from conn_user where dr = 0";
List<Object[]> result = (List<Object[]>) bd.executeQuery(sql, new ArrayListProcessor());
//查询语句只返回一行结果
String sql="select * from conn_user where pk_user='pk'";
Map<String, Object> result = (Map<String, Object>) bd.executeQuery(sql, new MapProcessor());
//查询语句可以返回多行结果
String sql="select * from conn_user where dr = 0";
List
//查询语句只返回一个VO
String sql="select * from conn_user where pk_user='pk'";
UserVO result = (UserVO) bd.executeQuery(sql, new BeanProcessor(UserVO.class));
//查询语句返回多个VO
String sql="select * from conn_user where dr = 0";
List<UserVO> result = (List<UserVO>) bd.executeQuery(sql,new BeanListProcessor(UserVO.class));
bd.executeUpdate(sql);
前台数据库操作方法(client端):
前台提供两个主要接口进行CURD操作:
IVOPersistence 该接口只支持前台增删改操作
IUAPQueryBS 该接口主要支持前台的查询操作
//processor跟第一点的basedao用法一致
IUAPQueryBS bs = NCLocator.getInstance().lookup(IUAPQueryBS.class);
bs.executeQuery(sql, processor);
常用查询操作方法:
//后台通过主表主键查询AggVO
BillQuery<AggUserVO> bq = new BillQuery<>(AggUserVO.class);
bq.query(pk);
//前台通过主表主键查询AggVO
HYPubBO_Client.queryBillVOByPrimaryKey(AggUserVO.class, pk)
//前后台都能用
IBillQueryService bq = NCLocator.getInstance().lookup(IBillQueryService.class);
姓 名:Conn
邮 箱:[email protected]
如果我有帮助到你 帮忙点个赞 谢谢
如果有问题 请联系我 我会尽力帮助你