EJPA (Easier Java Persistence API) 是一个基于 Annotation ,无配置的 ORM 框架。
示例代码:
public static void main(String[] args)
{
DatabaseManager dbm = DatabaseManager.getDatabaseManager(…);
dbm. saveObject (new Customer(“smith”, “John”));
Customer customer = new Customer(“Smith”);
if ((customer = dbm. loadObject (customer)) != null)
customer.getSupport().add(new Support(…));
dbm. saveObject (customer);
}
Collection list = new ArrayList();
list = dbm.loadObjects (list, Customer.class);
…