db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Embedding fields of non-persistent types even when field-type is used
Date Sat, 28 Jul 2007 03:21:52 GMT
Hi Michelle,

The problem is that if you declare the PI* address property in  
PICompany as
PIAddress getAddress()
void setAddress(PIAddress)

then it doesn't implement ICompany any more, since you also need  
these from the ICompany interface:
IAddress getAddress()
void setAddress(IAddress)

And of course these are the methods that the e.g. FC classes  
implement by casting the input IAddress to FCAddress. Which is what  
we want the generated PICompanyImpl to do because we specify that the  
type of the field is PIAddress.

Craig

On Jul 27, 2007, at 3:45 PM, Michelle Caisse wrote:

> I think that this is just an issue with the declarations in the  
> classes. In the PI classes, the address fields were declared as I*,  
> whereas I think we really wanted them to be PI*. With this change,  
> the address fields are instances of persistent interfaces, and  
> there should be no problem
>
> -- Michelle
>
> Craig L Russell wrote:
>
>>
>> On Jul 27, 2007, at 10:03 AM, Michelle Caisse wrote:
>>
>>> JPOX doesn't support embedding fields of non-persistent types  
>>> even  when the field-type attribute is used to specify the  
>>> specific type.  The TCK now uses inheritance from non-persistent  
>>> interfaces, which  allowed us to simplify the coding of new pc  
>>> classes, but doesn't  work with the embedded Address field.
>>
>>
>> This is an issue. Is JPOX able to fix this? The alternatives are  
>> not  pretty, since we use both persistent classes and persistent   
>> interfaces in the model. The setAddress(IAddress) methods need to  
>> be  implementable by both the persistence provider and the tck code.
>>
>> Any ideas?
>>
>> Craig
>>
>> 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!
>>
>

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