Re: [smartweb-devel] Smartweb Auth and problem with XDoclet/ Hibernate union subclass
Brought to you by:
rlogiacco
|
From: Roberto Lo G. <rlo...@us...> - 2007-11-07 11:48:48
|
The problem using sequence generator is some database doesn't support
sequences: the consequence will be an unsable auth module on those
databases.
An analysis og pros and cons of the two choices could be more helpful.
Joined Subclass
Pros
# Well known and supported by xdoclet without needing to be patched
# Supported by all databases
# Allows database constraints
# Better performances if a list of Subjects is requested (only id and
display properties)
Cons
# Requires an additional Subject table
# Full queries on Subject, User or Group needs a JOIN on twoor three
tables
# Pessimistical locking need to acquire 2 locks
Union Subclass
Pros
# Better performances on quering User and Group entities as no JOIN is
requested
# No additional table exposed
# Easier to query using plain SQL outside Hibernate
Cons
# Quering Subject needs a UNION, whatever infos you need
# Same field on two tables
# Needs sequence support on the database
Gaetano Perrone wrote:
>
> I delve into the problem and hibernate documentation says that identity
> generator strategy is not allowed in union subclass inheritance, indeed
> the primary key seed has to be shared accross all unioned subclasses of a
> hierarchy.
> The suggested approch for generating table for concrete class is to use a
> sequence generator strategy instead of native. With this approch each
> table defines columns for all properties of the class, including inherited
> properties. The limitation of this approach is that if a property is
> mapped on the superclass, the column name must be the same on all subclass
> tables. (Hibernate group is going to relax this in a future release).
> This means that a dedicated class tree sequence could be
> introduced....Otherwise i don't know what happens using the
> hibernate_sequence as sequence instead of generator native...
> What do u thing about it??
>
--
View this message in context: http://www.nabble.com/Smartweb-Auth-and--problem-with-XDoclet--Hibernate-union-subclass-tf4761003s17546.html#a13625607
Sent from the SmartWeb Developers mailing list archive at Nabble.com.
|