MiniDao 是一款轻量级JAVA持久层框架,基于 SpringJdbc + freemarker 实现,具备Mybatis一样的SQL分离和逻辑标签能力。Minidao产生的初衷是为了解决Hibernate项目,在复杂SQL具备Mybatis一样的灵活能力,同时支持事务同步。
成都地区优秀IDC服务器托管提供商(创新互联).为客户提供专业的德阳服务器托管,四川各地服务器托管,德阳服务器托管、多线服务器托管.托管咨询专线:13518219792
当前版本:v1.8.3 | 2021-08-09
An powerful enhanced toolkit of SpringJdbc for simplify development
具有以下特征:
- @MiniDao
- public interface EmployeeDao {
- @Arguments({ "employee"})
- @Sql("select * from employee")
- List
- @Sql("select * from employee where id = :id")
- Employee get(@Param("id") String id);
- @Sql("select * from employee where empno = :empno and name = :name")
- Map getMap(@Param("empno")String empno,@Param("name")String name);
- @Sql("SELECT count(*) FROM employee")
- Integer getCount();
- int update(@Param("employee") Employee employee);
- void insert(@Param("employee") Employee employee);
- @ResultType(Employee.class)
- public MiniDaoPage
getAll(@Param("employee") Employee employee,@Param("page") int page,@Param("rows") int rows);
- SELECT * FROM employee where 1=1
- <#if employee.age ?exists>
- and age = :employee.age
- #if>
- <#if employee.name ?exists>
- and name = :employee.name
- #if>
- <#if employee.empno ?exists>
- and empno = :employee.empno
- #if>
- public class Client {
- public static void main(String args[]) {
- BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext.xml");
- EmployeeDao employeeDao = (EmployeeDao) factory.getBean("employeeDao");
- Employee employee = new Employee();
- String id = UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
- employee.setId(id);
- employee.setEmpno("A001");
- employee.setSalary(new BigDecimal(5000));
- employee.setBirthday(new Date());
- employee.setName("scott");
- employee.setAge(25);
- //调用minidao方法插入
- employeeDao.insert(employee);
- }
- }
文章标题:MiniDao1.8.3版本发布,轻量级Java持久化框架
路径分享:http://www.shufengxianlan.com/qtweb/news13/74513.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联