openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Quick question on cascade persist
Date Tue, 17 Oct 2006 19:04:58 GMT
Hi,

If I define a cascade persist field in an EntityX and that field is  
declared to be of type EntityA but at runtime contains a non-Entity  
subclass of the EntityA, (e.g. NonEntityB extends EntityA), what  
happens at commit?

I expect that an IllegalArgumentException is thrown because when you  
try to persist the field, it finds the NonEntityB, which is not an  
Entity.

The spec seems to indicate that this is an error but apparently some  
implementations allow NonEntityB to be persisted as if it were an  
EntityA and when read from the database later, is read as an EntityA.

Yes, I can write a test case but I thought this would be easier (for  
me).

Thanks,

Craig

Craig Russell
clr@apache.org http://db.apache.org/jdo



Mime
View raw message