Jfinal Db + Record mode-ORM framework

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.