[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: many table, one entity, annotation driven?

Hi again;

speaking of "tinsel" and obscure database design:

Kristian Rink schrieb:
[...]
>> @Entity
>> @DiscriminatorValue("NEWSLETTER")
>> @Table(name="NEWSLETTER")
>> @PrimaryKeyJoinColumn(name="IDREF")
> [...]

While this approach (@DiscriminatorColumn / @DiscriminatorValue) does rather
well do in most situations (and, for that matters, makes migration of our DB
abstraction a rather pleasant procedure), I now have stumbled across a set
of situations in which this is not applicable, because, even though the
hierarchy is right the same (extending classes, common base class, separate
tables), there is no column usable as discriminator, leaving our backend
system obviously doing a simple join across the two tables using the common
ID, assuming the Discriminator is not required as "while the data is in the
'extending class' table, it per se must extend 'common' and thus have an
entry there". Which leaves me dealing with this... simply dumping the
@Discriminator* annotations, as supposed, broke my code again... Any way of
doing an inheritance hierarchy here without @Discriminator*? And, asides
that, any good books to be read on JPA dealing with these issues? Don't want
to steal anyones time...

Cheers & thanks for your patience,
Kristian

-- 
Kristian Rink * http://zimmer428.net * http://flickr.com/photos/z428/ jab:
kawazu@xxxxxxxxxxxxx * icq: 48874445 * fon: ++49 176 2447 2771 "One dreaming
alone, it will be only a dream; many dreaming together is the beginning of a
new reality." (Hundertwasser)