From jdo-commits-return-2740-apmail-db-jdo-commits-archive=www.apache.org@db.apache.org Sun Apr 25 13:16:39 2010
Return-Path:
| Feature | JDO | JPA |
|---|---|---|
| JDK Requirement | 1.3+ | 1.5+ |
| Usage | J2EE, J2SE | J2EE, J2SE |
| Persistence specification mechanism | XML, Annotations, API | XML, Annotations |
| Datastore supported | Any | RDBMS only |
| Restrictions on persisted classes | no-arg constructor (could be added by compiler/enhancer) | No final classes. No final methods. Non-private no-arg constructor. Identity Field. - Version Field. |
| Ability to persist "transient" fields | Yes | No |
| Persist static/final fields | No | Not specified |
| Transactions | Pessimistic, Optimistic | Optimistic |
| Object Identity | datastore-identity, application-identity | application-identity |
| Object Identity generation | Sequence, Table, Identity, Auto, UUID String, UUID Hex | Sequence, Table, Identity, Auto |
| Change objects identity | Throw exception when not allowed | Undefined !! |
| Supported types | Java primitive types, wrappers of primitive types, java.lang.String, java.lang.Number, java.math.BigInteger, java.math.BigDecimal, + Version Field. | |
| Ability to persist "transient" fields | Yes | No |
| Persist static/final fields | No | Not specified |
| Transactions | Pessimistic, Optimistic | Optimistic, some locking |
| Object Identity | datastore-identity, application-identity | application-identity |
| Object Identity generation | Sequence, Table, Identity, Auto, UUID String, UUID Hex | Sequence, Table, Identity, Auto |
| Change objects identity | Throw exception when not allowed | Undefined !! |
| Supported types | Java primitive types, wrappers of primitive types, java.lang.String, java.lang.Number, java.math.BigInteger, java.math.BigDecimal, java.util.Currency, java.util.Locale, java.util.Date, java.sql.Time, java.sql.Date, java.sql.Timestamp, java.io.Serializable, boolean[], byte[], char[], double[], float[], int[], long[], short[], java.lang.Object, interface, @@ -27,10 +27,10 @@ java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time, java.sql.Timestamp, java.io.Serializable, byte[], Byte[], char[], Character[], Enums, java.util.Collection, java.util.Set, java.util.List, java.util.Map - Collection/List/Map of persistable types | |
| Embedded Fields | Embedded persistent objects, Embedded Collections, Embedded Maps | Embedded persistent objects |
| Access a non-detached field | Throw exception | Undefined !! |
| Inheritance | Each class has its own strategy | Root class defines the strategy |
| Operation cascade default | persist, (delete) | |
| Operation Cascade configuration | delete | persist, delete, refresh |
| Query Language | JDOQL, SQL | JPQL, SQL |
| Query candidates | Candidate without subclasses, Candidate and its subclasses | Candidate and its subclasses |
| Query language case sensitivity | JDOQL lowercase/UPPERCASE | JP QL case-insensitive |
| Query language aliases | No, but has variables in JDOQL | Yes in JPQL |
| Query Criteria API | No, available as extension in QueryDSL | Yes |
| Object retrieval control | Lazy loading, eager fetching, fetch groups | Lazy loading, eager fetching |
| Bulk update/delete | JDOQL Bulk Delete | JPQL Bulk Delete, JPQL Bulk Update |
| RDBMS Schema Control | Tables, columns, PK columns, PK constraints, FK columns, FK constraints, index columns, + Collection/List/Map of persistable types | |
| Embedded Fields | Embedded persistent objects, Embedded Collections, Embedded Maps | Embedded persistent objects |
| Access a non-detached field | Throw exception | Undefined !! |
| Inheritance | Each class has its own strategy | Root class defines the strategy |
| Operation cascade default | persist, (delete) | |
| Operation Cascade configuration | delete | persist, delete, refresh |
| Query Language | JDOQL, SQL, others | JPQL, SQL |
| Query candidates | Candidate without subclasses, Candidate and its subclasses | Candidate and its subclasses |
| Query language case sensitivity | JDOQL lowercase/UPPERCASE | JPQL case-insensitive |
| Query language aliases | No, but has variables in JDOQL | Yes in JPQL |
| Query Criteria API | No, available as extension in QueryDSL | Yes |
| Object retrieval control | Lazy/Eager control, fetch groups | Lazy/Eager control |
| Bulk update/delete | JDOQL Bulk Delete | JPQL Bulk Delete, JPQL Bulk Update |
| RDBMS Schema Control | Tables, columns, PK columns, PK constraints, FK columns, FK constraints, index columns, index constraints, unique key columns, unique key constraints | Tables, columns, PK columns, FK columns, unique key columns |
| ORM Relationships | Full range of Collection, Map, List, Array, 1-1, 1-N, M-N using PC, Non-PC and interface objects | Basic 1-1, 1-N, M-N, Collection<NonPC>, Map<NonPC> |
| Default ORM column size | 256 | 255 |
| Default ORM identifiers (tables/columns) | No | Yes |
| Default ORM mappings | Yes, JDBC types defined for Java types | No |
| Caching interface | L2 Caching API | L2 Caching API |
- As an overall conclusion "JPA1" is a subset of what is already available in "JDO2". + As an overall conclusion "JPA" is a subset of what is already available in "JDO".