Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #3494

Re: Hibernate

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: Hibernate
References <MPG.282a127c2a93232998972a@news.justthe.net>
Message-ID <sc9wp.8843$Du7.8665@newsfe04.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2011-05-04 06:42 -0300

Show all headers | View raw


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.
> 
> That is all. :)

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. At least in a Java EE environment. I'm not a
Hibernate guy any more - haven't been since the first few years after it
came out - but I see that since 3.5 Hibernate has had JPA 2 support, and
I'd expect that by now it's in pretty good shape.

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.

Why use JPA at all? It's standard. It simplifies your reasoning about
persistence. Considering that there will still be plenty of need to
think about caching strategies, and persistent object lifetimes, and
query optimization, and object relationships, and lazy loading - in any
API and implementation that you choose - it's not a bad idea to
standardize and simplify what you can.

My 2 cents worth.

AHS

-- 
Governor Thomas was so pleas'd with the Construction of this Stove, as
describ'd in it, that he offer'd to give me a Patent for the sole
Vending of them for a Term of Years; but I declin'd it from a Principle
which has ever weigh'd with me on such Occasions, viz. That as we enjoy
great Advantages from the Inventions of Others, we should be glad of an
Opportunity to serve others by any Invention of ours, and this we should
do freely and generously.
-- Benjamin Franklin

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Hibernate Steve Sobol <sjsobol@JustThe.net> - 2011-05-03 14:24 -0700
  Re: Hibernate Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-05-04 06:42 -0300
    Re: Hibernate Steve Sobol <sjsobol@JustThe.net> - 2011-05-04 13:19 -0700
    Re: Hibernate Tom Anderson <twic@urchin.earth.li> - 2011-05-04 23:13 +0100
      Re: Hibernate Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-05-05 13:39 -0300

csiph-web