EJP is a powerful and easy-to-use http://www.aliyun.com/zixun/aggregation/22.html "> relational database persistence Java API. The main features of EJP include:
1. Object/Relationship (object/relational) automatic mapping (A-O/RM) 2, automatic processing of all associations 3, automatic persistent tracking
EJP does not require mapping annotations or XML configurations, and does not require inheriting any classes or implementing any interfaces. EJP only uses the plain old Java Objects (POJOs) object. So far, EJP is the simplest persistent API in Java open source.
Easy Java Persistence 2.4 A great feature is the automatic processing of primary and foreign keys, so that they only need to define where they need in the code. This release also fixes a batch of errors when saving objects.
public static void Main (string] args) {Databasemanager dbm = Databasemanager.getdatabasemanager (...); Dbm.saveobject ( New Customer ("Smith", "John")); Customer customer; if (Customer = Dbm.loadobject (New customer ("Smith"))!= null) {Customer.getsupport (). Add (New Support (...)); Dbm.saveobject (customer); } collection<customer> list = new arraylist<customer> (); List = dbm.loadobjects (list, customer.class); ... }
It ' s used with normal class definitions like the following:
public class Customer {String firstName, lastName; List<support> Support; List<order> orders; . Public Customer (String lastName) {this.lastname = lastName} ... public getfirstname () {return firstName; Setfirstname (String firstName) {this.firstname = firstName;} public Getlastname () {return lastName;} public Setlastname ( String lastName) {this.lastname = LastName} ...//associations (Automatic) public list<support> Getsupport () { return support; public void Setsupport (list<support> Support) {this.support = Support;} public list<order> getorders () { return orders; public void Setorders (list<order> orders) {this.orders = orders;}
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.