zxormscala的ORM框架
zxorm 是一个 scala 的 轻量级 orm,代码简洁高效
查询
DBEntity.queryOne(classOf[User],"select * from User where name=? ",name)
DBEntity.query(classOf[User], "select * from Users)")
增加
new User(0,"tom",12).insert // id=1,name=tom,age=12
new User(0,"tomcat",18).insert("name") //id=2,name=tomcat,age=null
修改
new User(2,"dog",22).update("id","name")//id=2,name=dog,age=18
new User(2,"tomcat",30).update("id")//id=2,name=tomcat,age=30
评论