Skip to content
FTLLOVEPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

EASY-ORM

特性

  • 无侵入式
  • 强大的CURD
  • 链式ORM
  • 内置分页
  • 支持MYSQL,Oracle多种数据库
  • 配置简单
  • 内置Bean
  • 强悍的查询表达式

简单使用

准备一个bean对象,以Student对象为例
import java.io.Serializable;

public class Student implements Serializable {
	
	private static final long serialVersionUID = 1L;
		
   private int id;
   
	private String name;
	
	private int age;
	
	private int sex;
   
   // GET SET ....
	
}

增

public void insertOne() throws Exception {
		Student student = new Student();
		student.setName("豆芽菜");
		student.setAge(26);
		student.setSex(1);
		mysqlDao.insert(student); // 需要在Spring容器中注入MYSQLDao这个Bean对象
}

删

删除id=1的学生对象

public void deleteOne() throws Exception {
		Criteria criteria = new Criteria("id=?", 1);
		mysqlDao.delete(Student.class, criteria);
}

改

public void updateOne() throws Exception {
		Criteria criteria = new Criteria("id=?", 1);
		Student student = new Student();
		student.setName("张三");
		mysqlDao.update(student, criteria);
}

未完待续。。。

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors