cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: Persistence and inheritance : a noob question
Date Tue, 28 Nov 2006 21:22:18 GMT
Are you wanting multiple tables or a single table?  Cayenne will
currently do a single table mapped to multiple Java classes pretty
well.  You have to have a discriminator column (an int or a char, etc)
which Cayenne can use to detect which Java class to create.  Such as 1
= Customer, 2 = VIP, etc.

/dev/mrg


On 11/28/06, Landry Soules <cayenneml@gmail.com> wrote:
> Hello,
>
> I'm a new user of Cayenne, and am facing a design problem. Here it is :
> I would like to implement the following :
> - a Person abstract class (with first name, last name and so on
> properties), extended by Customer and Vip classes.
> In my mind, Person wouldn't be persistent, whereas Customer and Vip
> would, meaning having only customer and vip tables.
> Does this fit into the FAQ's CompositeVerticalInheritence, or does exist
> a simpler alternative, since i must admit i didn't understand how to use
> it ?
>
> Thanks
>
> Landry Soules
>

Mime
View raw message