Re: Does anyone use postgreSQL(windows version)+Hibernate with middlegen? - Mailing list pgsql-general

From Craig Ringer
Subject Re: Does anyone use postgreSQL(windows version)+Hibernate with middlegen?
Date
Msg-id 49E7F588.6070409@postnewspapers.com.au
Whole thread Raw
In response to Does anyone use postgreSQL(windows version)+Hibernate with middlegen?  (rolandpeng <rolandpeng@cht.com.tw>)
Responses Re: Does anyone use postgreSQL(windows version)+Hibernate with middlegen?
List pgsql-general
rolandpeng wrote:

> How do you resolve this problem? or If you use postgreSQL+Hibernate3,how do
> you maintain your *.hbm.xml and entities?

I use Hibernate 3 with PostgreSQL via JPA (Hibernate EntityManager). I
maintain my entity definitions by hand.

I find generated solutions to generally be unsatisfactory. They don't
tend to preserve my customizations for eager/lazy fetching,
updatability, etc, nor my entity initialization changes. They don't
generally handle domain types all that well, and they don't always pick
the best type to map for a PostgreSQL field.

They tend to clobber my documentation, too.

They have a lot of trouble with things like NOT NULL fields that are set
by a server-side trigger, so the client application *MUST* *NOT* set
them on INSERT even though they're NOT NULL in the schema. Yet I have
one problem that I have only been able to solve in exactly this way.
It's easy to handle in a custom binding (set nullable=true,
updatable=false) but binding generators just don't and can't have that
kind of knowledge.

Bindings generators are useful as a starting point, but unless your
schema is really rather simple I'm not convinced about their long-term
utility.

--
Craig Ringer

pgsql-general by date:

Previous
From: rolandpeng
Date:
Subject: Does anyone use postgreSQL(windows version)+Hibernate with middlegen?
Next
From: rolandpeng
Date:
Subject: Re: Does anyone use postgreSQL(windows version)+Hibernate with middlegen?