本文共 875 字,大约阅读时间需要 2 分钟。
EJP是一个强大并且易于使用的关系数据库持久化Java API。EJP的主要特性包括:
1、对象/关系(object/relational)自动映射(A-O/RM)
2、自动处理所有关联
3、自动持久化跟踪
EJP不需要映射注释或XML配置,并且不需要继承任何类或实现任何接口。EJP只用到了Plain Old Java Objects (POJOs)对象。到目前为止,EJP是Java开源中最简单的持久化API。
示例代码:
publicstaticvoidmain(String[] args)
{
DatabaseManager dbm = DatabaseManager.getDatabaseManager(...);
dbm.saveObject(newCustomer("Smith","John"));
Customer customer;
if((customer = dbm.loadObject(newCustomer("Smith"))) !=null)
{
customer.getSupport().add(newSupport(...));
dbm.saveObject(customer);
}
Collection list =newArrayList();
list = dbm.loadObjects(list, Customer.class);
...
}
此次更新的主要内容:
◆ This release fixes all known issues.
◆ All functionality/features have been thoroughly tested on every major database platform (Oracle, DB2, PostgreSql, Mysql, SQL Server, HSQL, H2, and Derby).
◆ 支持Blog和Transaction
◆ 支持存储过程
【编辑推荐】
【责任编辑:小林 TEL:(010)68476606】
点赞 0
转载地址:https://blog.csdn.net/weixin_39817176/article/details/114221188 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!