users@glassfish.java.net

RE: Re: TLE vs Hibernate

From: Jason Lee <lee_at_iecokc.com>
Date: Fri, 16 Mar 2007 08:45:55 -0500

In my testing, I'm using Sun Java System Application Server 9.1 (build
b38-rc). In production, though, we're still on v1 ur1 p01.

-----
Jason Lee, SCJP
Senior Software Engineer
http://www.iec-okc.com
 

> -----Original Message-----
> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
> Sent: Thursday, March 15, 2007 5:55 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: TLE vs Hibernate
>
> Jason,
>
> Are you using the latest v2 build?
>
> thanks,
> -marina
>
> Jason Lee wrote:
> > In all of our apps, we are currently using Hibernate as the JPA
> > provider due to what we (read as, I) understood to be a bug in TLE
> > with regard to SequenceGenerators and PostgreSQL. I'd
> really like to
> > use TLE, as I'm not a big fan of the extra configuration step in
> > setting up our applications, nor am I, as our de facto GlassFish
> > admin, a big fan of the extra installation step of adding
> the Hibernate jars to the server.
> > Those are two points of failure I'd like to avoid. To that end, I
> > started testing an app of mine using TLE and hit a snag.
> Here's part
> > of my entity POJO:
> >
> > @Entity
> > @Table(name = "engineers")
> > @SequenceGenerator(name = "ENGINEERS_SEQ", allocationSize = 1,
> > sequenceName = "engineers_seq") public class Engineer implements
> > Serializable {
> > @Id
> > @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> > "ENGINEERS_SEQ")
> > protected Integer id;
> > With Hibernate, when I would create a new Engineer object, i could
> > just call entityManager.persist(engineer) and be done with
> it. When
> > switch to TLE, the database barks because the ID has not been set.
> > Short of changing the tables to have a default value of
> > nextval($SEQ_NAME), how do I approach this using TLE?
> >
> > I even tried this:
> >
> > @Id
> > @SequenceGenerator(name = "ENGINEERS_SEQ", allocationSize = 1,
> > sequenceName = "engineers_seq")
> > @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> > "ENGINEERS_SEQ")
> > @Column
> > protected Integer id;
> > based on the documentation here
> >
> http://www.oracle.com/technology/products/ias/toplink/jpa/resources/to
> > plink-jpa-annotations.html#SequenceGenerator with no love. :)
> >
> > -----
> > Jason Lee, SCJP
> > Senior Software Engineer
> > http://www.iec-okc.com <http://www.iec-okc.com/>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>