X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe07.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Hibernate foreign key as primary key References: <4e3e78a1@dnews.tpgi.com.au> <9a7tq6FspmU1@mid.individual.net> <9a7vglFa7hU1@mid.individual.net> <4e3fb5d8@dnews.tpgi.com.au> <4e40f5a1@dnews.tpgi.com.au> In-Reply-To: <4e40f5a1@dnews.tpgi.com.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 73 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Wed, 10 Aug 2011 00:45:38 UTC Organization: Public Usenet Newsgroup Access Date: Tue, 09 Aug 2011 21:45:37 -0300 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6942 On 11-08-09 05:56 AM, Lionel wrote: > On 09/08/11 07:26, Arved Sandstrom wrote: >> On 11-08-08 07:11 AM, Lionel wrote: >> [ SNIP ] >> >>> I thought there might be more knowledge of hibernate on this forum, but >>> based on the responses it seems it is too specific for this forum. I >>> just wasn't getting responses to other questions on the Hibernate forum >>> (and neither were many other people though there are a high number of >>> posts) so I decided to try on my preferred medium :). >>> >>> Thanks everyone for your input. >>> >>> Lionel. >> >> It's one thing if you're not getting Hibernate-specific answers here; >> it's something else entirely if you (and a bunch of other folks) are not >> getting answers on Hibernate forums. >> >> A suggestion I have is to consider the use of JPA. If you're happy with >> Hibernate keep it as a JPA provider, but stick with the JPA 2 >> specification, and use annotations. XML configuration files are better >> than straight text configuration files, by a long shot, but they are in >> turn inferior to annotations; JPA radically cuts down on XML. >> >> The advantage of sticking with JPA is that it's the overall Java >> persistence specification. You're no longer tied to a specific ORM. >> There's also likely more people and more forums that can answer JPA >> questions...including here. I stopped wasting my time with >> Hibernate/Toplink mapping XML as soon as JPA 1.0 appeared. > > I had wondered about JPA as I was starting with Hibernate. But I'm > hesitant to back-pedal as this is a project with limited funding. > > I actually prefer the XML mapping approach, the annotations add a lot of > noise to what can otherwise be a clean model. It may be personal > preference but I like the separation. > > Does JPA provide the same features as Hibernate? Well, if you're using Hibernate as the JPA persistence provider then the features are identical. :-) Seriously, though, the entire point of JPA has been to look at what various Java ORMs have done, and to arrive at a standard that incorporates the important and useful bits. Hibernate has informed the JPA process quite a lot; especially with JPA 2 and provider customization features I think you'll be hard-pressed to find something you need to do that forces you to stray from JPA. I haven't used Hibernate in a few years, but I expect that if necessary you can do with it, in a JPA environment, what one can do with EclipseLink; namely, retrieve references to native implementation objects and use those if necessary. > Can you easily > configure any DBMS? Yes. There is a reasonably standard way of doing so in JPA. Ultimately as you might expect it still boils down to JDBC connection properties and DataSources and what have you. > Does it manage objects like Hibernate? Yes. There are ORMs and then there are ORMs - some don't go much past mapping and others are fully-fledged persistent object managers. JPA is intended to support persistent object management, apart from mapping, so native persistent object managers in Hibernate and EclipseLink, such as sessions/units-of-work, translate fairly directly to the JPA entity manager. [ SNIP ] AHS