Java持久層框架 Easy Java Persistence 2.6 發布
EJP是一個強大并且易于使用的關系數據庫持久化Java API。它擁有以下特性:
- Automatic object-relational mapping (A-O/RM)
- Automatic tracking of object persistence
- Mapping is automatic; there is no configuration, or annotation required
- All associations are automatic
- Handles associations with single instance, arrays, and collections
- Automatic support for join inheritance
- Support for single table inheritance and concrete table inheritance
- Objects are isolated from database changes, and vice versa
- Full Support for MySQL, DB2, Oracle, Derby, HSQL, PostgreSQL, H2, and more
- Object-oriented queries, inserts, updates, deletes and more
- Intermix objects with SQL, and use object properties in SQL fragments
- Full support for batch updates
- Full support for database transactions
- Supports any JDBC source including DriverManager, JNDI, and DataSource
- Support for third-party connection pooling (DBCP, C3PO, etc.)
- No SQL required for queries, inserts, updates, deletes
- Uses JDBC with access to underlying connection, statement and result set
- Implements ListIterator and Iterable for object-oriented iteration through data
- Multiple utilities for loading data into collections and maps
- All JDBC functionality is supported
Easy Java Persistence 2.6 發布,更新如下:
A problem with schema oriented databases (PostgreSQL, Oracle, etc.) where the users default schema was being used instead of the requested schema was fixed. nullValuesToIncludeInSaves was deprecated, as null values will now always be saved. setMetaDataLimits was replaced with setCatalogPattern and setSchemaPattern. Another alternative for handling caching was added.
EJP的主要特性包括:
1、對象/關系(object/relational)自動映射(A-O/RM)
2、自動處理所有關聯
3、自動持久化跟蹤
EJP不需要映射注釋或XML配置,并且不需要繼承任何類或實現任何接口。EJP只用到了Plain Old Java Objects (POJOs)對象。到目前為止,EJP是Java開源中最簡單的持久化API。
示例代碼:
public static void main(String[] args) { DatabaseManager dbm = DatabaseManager.getDatabaseManager(...);項目地址: http://www.easierjava.com/webapp.ejw?c=ejpdbm.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); ... }</pre>
本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!