db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Determine which child table a record belongs to
Date Tue, 29 Jan 2008 23:07:05 GMT

On Jan 29, 2008, at 10:49 AM, MZ_TRICSTA wrote:

>
> One last question, guys. What if there is overlapping between the  
> child
> tables, so that one instance has more than one "Type"?

Then you might want to model this as an Entity-Role relationship which  
allows multiple rows in associated tables for the same row in the  
primary table.

If this is the case, then you can't use a single-valued discriminator.  
You could use a bit field represented as a number in which each bit  
corresponds to an associated Role with data in another table.

Craig
>
>
>
> Craig L Russell wrote:
>>
>> This is a very common pattern in object-relational mapping. The  
>> column
>> that contains the type of crane is commonly referred to as a
>> discriminator column, and is commonly a CHAR, VARCHAR, or NUMERIC
>> type. The value of the discriminator column that identifies which
>> table to look for is referred to as a discriminator value.
>>
>> The alternative is to include all possible tables in a query, which  
>> is
>> performance-limiting.
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
> -- 
> View this message in context: http://www.nabble.com/Determine-which-child-table-a-record-belongs-to-tp15164998p15166419.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message