Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA2 - what's new?

 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article has a nice overview of what's new in JPA 2: http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part3.html
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ionut Bucurescu
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is missing from JPA2? Any weak points or things that did not get into the spec but would be useful?
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic