This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes JPA2 - what's new? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA2 - what Watch "JPA2 - what New topic
Author

JPA2 - what's new?

Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226
Hi Mike, Merrick and all in the forum,

I'm currently actively reading Pro EJB 3: Java Persistence API whilst studying towards SCBCD and just wanted to take this opportunity to thank you both for such a well written book. If your new Pro JPA 2: Mastering the Java Persistence API book is of a similar standard, I am sure it will be a great success.

The main question for me would be to ask what JPA2 gives me? What extra things can I now do? What things are simpler than in JPA? What issues are people finding in the field with JPA, and how does JPA2 aim to solve them?

Thanks,

MG


28/06/06 - SCJP - 69%, 05/06/07 - SCWCD - 92%, 28/02/08 - IBM DB2 v9 Fundamentals (Exam 730) - 87%, 18/11/08 - IBM DB2 v9 DBA (Exam 731) - 89%, 26/02/11 - SCBCD - 88%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41087
    
  43
This article has a nice overview of what's new in JPA 2: http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part3.html


Ping & DNS - my free Android networking tools app
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Hi Mark,

The JPA 2.0 spec offers a lot of new flexibility that did not get included in the 1.0 spec. For example, there are many new advanced mapping types, particularly for mapping to legacy databases, there are now typed queries (so you don't have to cast the result), there is a whole new criteria API for people that want to create queries dynamically using a Java-based API instead of JP QL, and much more! If you haven't had to go outside the spec for any feature in 1.0 then you might not need to upgrade to 2.0, but if there was any time when you felt you were missing something then you might want to consider looking at 2.0.


-Mike
Pro JPA 2: Mastering the Java Persistence API
Ionut Bucurescu
Ranch Hand

Joined: Dec 19, 2006
Posts: 68
What is missing from JPA2? Any weak points or things that did not get into the spec but would be useful?


SCJP 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA5
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Yes. If you ask 10 different people you will get 10 different answers about what is missing from the spec. In general, though, we are at the stage of specifying the corner cases of the technology (once again, one person's corner case is another's mainstay).

I have my own list of features that I am going to attempt to get standardized. I don't really want to to divulge them here, though, until the group begins meeting again for the next round and agrees that they are worth working on.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I was looking at that article above, and I didn't see any mention on Cascade Option additions. Have they added something like DELETE-ORPHAN, or some other way to get that functionality?

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Mark Spritzler wrote:I was looking at that article above, and I didn't see any mention on Cascade Option additions. Have they added something like DELETE-ORPHAN, or some other way to get that functionality?

Thanks

Mark


Yes, we added an orphanRemoval() element on the @OneToOne and @OneToMany annotations to provide that functionality.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPA2 - what's new?
 
Similar Threads
Anyone Oracle Certified, EE 6 Java Persistence API Developer certifed?
JPA book query
JPA book query
JPA :Help me decide which book to purchase
Recommendations for JPA book