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.
Download Address: Http://www.easierjava.com/downloads/ejp_2.4.zip
EJP Application:
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;}