I have used eclipselink on one of the key projects lastyear. It was donated by Oracle to Eclipse foundation. Toplink became eclipselink. I was really impressed by its implementation of JPA and customizations such as Criteria Queries. Hoping to learn more from this session.
Supports JavaSE,EE,OSGi and Spring
Eclipselink solution comprises JPA implentation,Moxy,EIS,SDO(service data objects),DBWS (database webservice --> want xml from relational data ).
--> supports JPA 1.0 with many advanced features
--> simplified configuration of using annotations and/or xml.
--> Best ORM for Oracle database
-->EclipseLink is a runtime project supported by IDEs.
-->Eclipselink supported by Dali
-->Oracle Jdeveloper 11g,Enterprise Pack for eclipse
--> Standalone workbench(Swing project)
--> Eclipse,Oracle toplink,weblogic,glassfish,spring framework,JOnAS
JPA persistence Provider(eclipselink) sits between Java SE/EE and rdbms
Core JPA Mappings
ID (primary key)
Basic (field mappings)
Examples of Advanced Mappings
class level --> @Converter(name="",converterClass="")
field level --> @Convert(name="")
@PrivateOwned (coming in JPA 2.0) : doesnt exist without parent
Optimistic locking :
Custom Data type conversions:
5 different ways
Entity Model : JPQL
Native : SQL
Customizations in queries
--> Locking,Cache usage
--> Optimizations (batching,joining)
--> Result shaping/conversions
--> Stored Proc support
SQL and Stored Procedure directly hit db.
For other 3 query framework is used. Checks for Cache hit,Cache result is used using Object builder)
Annotations for stored procedures
@NamedStoredProcedureQuery and @NamedStoredProcedureQueries
eclipselink.read-only : useful in read only screens
Lazy loading & Fetch Groups
Two fetch groups defined automatically --> eagerly loaded fields and lazily loaded fields.Enabled by byte code weaving
Create your own fetch groups and added to query as hint. Overrides default fetch groups.
Caching Advantage :
Shared L2 and persistence context caching
--> Entity cache and not data cache like ehacache that comes with hibernate
Cache Invalidation --> time to live,fixed times, programmable
Cache Coordination --> Messaging,Type specific configuration (invalidate,sync,sync + new,none)
Invalidate is the most used and cheapest one
Annotations for caching : @Cache,@TimeofDay,@ExistenceChecking
Concurrency Protection :
@OptimisticLocking : Numeric,Timestamp,All Fields,Selected fields,Changed field
Pessimistic locking : using hit eclipselink.pessimistic-lock
Dealing with DB Triggers
@ReturnInsert and @ReturnUpdate : efficiently reread modified data in Oracle db.
@ChangeTracking annotation to configure the way changes to Entities are computed
Attribute level ,object level, deferred ,auto
Performance Options summary
--> Read only queries
--> parameter binding
--> dynamic expressions
Moxy : Object XML Binding
JavaApp --> Objects --> EclipselinkOXM --> xml
Rich set of mappings provides complete control to map objects to any XSD.
Eclipselink JAXB2 Annotations , Moxy XML
twice as fast as sun ri and xml beans.
1) Create factory,context
2) Marshal and UnMarshal
SDO : Xml Centric
Wow.. too fast session .. but left me lots to explore in JPA.
Eclipselink 1.1.2 released as part of Galileo
Eclipselink 2.0 --> Fall 2009 ; implements JPA 2.0
DBWS : Generated JAX-WS from DB