Create a Record object with the Name property of the James,age property of 25 and add it to the database record user = new record (). Set ("Name", "James"). Set ("Age",);D B.save (" User ", user); Delete the record Db.deletebyid in the user table with ID value 25 ("User", 25); A record with a query ID value of 25 changes its Name property to James and updates it to the database user = Db.findbyid ("user"). Set ("Name", "James");D b.update ("user", user); The query ID value is 25 for user, and only the value of name and age two fields is user = Db.findbyid ("user", "+", "name, age"); Gets the Name property of user String userName = user.getstr ("name"); Gets the Age property of user integer userage = user.getint ("Age"); Queries all users older than 18 years and outputs their Name property list<record> user = Db.find ("SELECT * from user where > 18"); Paged Query Gender 1 and older than 18 user, the current page number is 1, each page 10 userpage<record> userpage = db.paginate (1, ten, "SELECT *", "from user where SE X=? and Age>? ", 1, 18);//source snippet from cloud code http://yuncode.net
Jfinal Db + Record mode-ORM framework