Академический Документы
Профессиональный Документы
Культура Документы
Gordon Yorke
EclipseLink Architecture Committee Member, EclipseLink Core Technical Lead, JPA 2.0 Expert Group Member gordon.yorke@oracle.com
2008 by Gordon Yorke made available under the EPL v1.0 | March 20, 2008 |
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
What is EclipseLink
Based upon product with 12 years of commercial usage First comprehensive open source persistence solution EclipseLink JPA: Object-Relational EclipseLink MOXy: Object-XML EclipseLink SDO: Service Data Objects EclipseLink EIS: Non-Relational using JCA EclipseLink DBWS: Database Web Services
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
EclipseLink
Shared infrastructure Easily share the same domain model with multiple persistence technologies Leverage metadata for multiple services Providing enterprise data access and manipulation services to the Eclipse Ecosystem
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
JPA
MOXy
SDO
DBWS
EIS
JDBC
JCA
Relational Databases
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
ORM
Mappings
@Embeddables
multiple objects but data in same table
@Basic/@Id
Simple types mapping to single columns (ie. int, String)
@Lob
Binary based data (ie. Images)
@OneToOne, @ManyToOne
References to single target object.
@OneToMany, @ManyToMany
Collections and Maps
Class Inheritance
All classes in single table Extended fields in separate tables
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
EntityManager
Contains the lifecycle APIs for the Entities
persist(), remove(), merge()
Persistence Context
Set of objects tracked for changes by Persistence Provider Objects enter Persistence Context through EntityManager APIs Has two life expectancies
transactional entities are no longer tracked at end of transaction extended entities are tracked for life of Persistence Context unless cleared.
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Queries
Dynamic or statically defined (named queries) Criteria using JP QL (object based query language) Native SQL support (when required) Named parameters bound at execution time Pagination and ability to restrict size of result Single/multiple-entity results, data projections Bulk update and delete operation on an entity Standard hooks for vendor-specific hints
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
How to use it
Create Entities and Map
Simple POJOs annotations or XML Database can be pre-existing Generate table definitions later
Dali
Tooling for mapping and packaging persistence unit
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
META-INF/persistence.xml
Deployment configuration
Optional xml based mapping config (META-INF/orm.xml)
Can override annotations or provide full mapping config
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Java SE vs Java EE
Java SE deployment
Application managed EntityManagers
Local transactions Persistence Context always extended
Java EE
Container managed EntityManager
PersistenceContext JTA transaction scoped or extended @PersisteneContext annotation for injection
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Demo
Persistence Enable a Rich Client through bundles
Tools,
Dali EclipseLink
Troubleshooting
Check that the Persistence Unit Bundle is included in your launch Dali sets Persistence Unit name to project name by default make sure it matches the name in ComicsModel.java
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Mappings
@BasicMap, @BasicCollection, @PrivateOwned, @JoinFetch @Converter, @TypeConverter, @ObjectTypeConverter
@NamedStoredProcedureQuery
IN/OUT/INOUT parameters, multiple cursor results
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Extensions - Locking
Data Locking policies
Optimistic: Numeric, Timestamp, All fields, Selected fields, Changed field Pessimistic
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Expiration/Invalidation
Time to live, Time of day, API
Coordination (cluster-messaging)
Messaging: JMS, RMI, RMI-IIOP, Mode: SYNC, SYNC+NEW, INVALIDATE, NONE
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Flexibility allows efficient business models and relational schemas to be used Leverages underlying performance tuning features
Java, JDBC and the underlying database technology Batch Reading, Batch Writing, Joined Reading, etc
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
DEMO
Extensions in action
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse Projects
Dali JPA Tooling Project Teneo to use EclipseLink for EMF model persistence Maya for storage of deployment configuration SOA Project for EclipseLink SDO
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
Contributors
Contribute to roadmap discussions Bug fixes
Committers
Very interested in growing committer base
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0
More Information
www.eclipse.org/eclipselink Newsgroup: eclipse.technology.eclipselink Wiki: wiki.eclipse.org/EclipseLink Mailing Lists:
eclipselink-dev@eclipse.org eclipselink-users@eclipse.org
Blogs
Committer Team blog: eclipselink.blogspot.com
Eclipse JPA | 2008 by Gordon Yorke; made available under the EPL v1.0