Abator 生成 Ibatis 代码使用规范

1、 生成的文件类型pojoexampledaodaoImplsqlmap.xml

例如:

TcCinema.java

TcCinemaExample.java

TcCinemaDAO.java

TcCinemaDAOImpl.java

WD_WEB_TC_CINEMA_SqlMap.xml

2、 配置的异常处理办法

1)       报错:Could not find SQL statement to include with refid

sqlmap-config.xml加入

2)       如果类型错误

LONGVARCHAR 改成LONG.

或查看是否有LONGVARCHAR类型的驱动包

 

3、 函数介绍

1)       插入对象

void insert(TcCinema record)

 

2)       更新对象(除BLOB类型字段),条件通过where 主键=“”

int updateByPrimaryKeyWithoutBLOBs(TcCinema record)

 

3)       更新对象(包括BLOB类型所有字段),条件通过where 主键=“”

int updateByPrimaryKeyWithBLOBs(TcCinema record)

 

4)       更新对象,条件通过where 主键=“”,具体更新的字段自己在TcCinema定义。

int updateByPrimaryKeySelective(TcCinema record)

 

5)       通过对象example查找(不包括BLOB类字段)

List<TcCinema> selectByExampleWithoutBLOBs(TcCinemaExample example)

例:

TcCinemaExample example = new TcCinemaExample ();

       TcCinema tcCinema = new TcCinema();s

       example.createCriteria().andCinemaNameEqualTo("测试影院");

             List list=    tcCinemaService.selectByExampleWithoutBLOBs(example);

 

6)       通过对象example查找(包括BLOB类型所有字段)

List<TcCinema> selectByExampleWithBLOBs(TcCinemaExample example)

 

7)       通过主键id查找(包括BLOB类型所有字段)

TcCinema selectByPrimaryKey(String cinemaId)

 

8)       通过对象example删除

int deleteByExample(TcCinemaExample example)

 

9)       通过主键id删除

int deleteByPrimaryKey(String cinemaId)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值