Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe19.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Hibernate References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 60 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Thu, 05 May 2011 16:39:43 UTC Organization: Public Usenet Newsgroup Access Date: Thu, 05 May 2011 13:39:42 -0300 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3573 On 11-05-04 07:13 PM, Tom Anderson wrote: > On Wed, 4 May 2011, Arved Sandstrom wrote: > >> On 11-05-03 06:24 PM, Steve Sobol wrote: >> >>> I've finally started using Hibernate again, after a long sabbatical. >>> I really disliked having to declare each object in a separate XML >>> file, and I am very happy that I now only need hibernate.cfg.xml and >>> some annotations. >> >> Let me make one recommendation, Steve. Especially given that you have >> used Hibernate before, and some time ago. Try not to use Hibernate >> native APIs - stick to JPA. [...] With JPA 1.0 there were sizeable API >> gaps that made forays into native ORM (Toplink, EclipseLink, >> Hibernate, OpenJPA etc) APIs justifiable and somewhat common. But even >> with JPA 1.0-compliant implementations you could do most of your work >> with standard JPA. With JPA 2.0 it's much more comprehensive. > > In my limited experience of it, it does seem that way. > > There are still things missing, though. Do we have any idea what's going > to be in JPA 3.0, or whatever the next significant feature release is > going to be? > > Off the top of my head, things i'd like to see (caveat - these might > already be supported; there are many, many corners of JPA i don't know): There are many, many corners of JPA *I* don't know, or have seldom used. JPA 1.0 was already a good-sized spec, and JPA 2.0 added a lot. > * A standardised way to add new type mappings (eg i'd like to be able to > have a @Basic property of type Locale that gets stored as a varchar like > "en_GB" rather than a BLOB of serialized data as now. > > * Support for mapping properties of type SortedSet and SortedMap with > @OrderBy (at the moment, AFAIK, it has to be a list, which is not really > the right type, since if you're doing a normal mappedBy-type plural > property, you can't actually have duplicates!). Are you sure about that? That's not my understanding. The JPA API docs for @OrderBy mention collections, not Lists. On a side note, I'll mention that JPA 2.0 also introduced the @OrderColumn - there may be some use cases you have that are well-served with this. I am pretty sure I've used sorted sets before as an @OrderBy, but now I'll have to try it and confirm. > * An easier way of handling composite keys - i'd like to be able to do > something like annotate multiple properties with @Id, and then use > object arrays (or perhaps instances of Tuple) as keys. Similar to the > situation with @IdClass now, but without having to write a class just to > wrap the key. Agreed. I stand to be corrected, but I don't think you can do this. I'll have to digest the @Mapsid documentation before I comment, but I think you're on the right track. It's hard to absorb all the different things one can do now with composite keys in JPA 2.0. AHS