Hi,

I'm constructing entities based on their filled data object. Eg. I get the
plain data from a text file, or XML, fill the data object based on it,
create an empty entity (it uses my custom autonumber factory to generate the
id), and do newbean.setData(filledDataObject).

That aspect looked good, until I realized, that the primary key is part of
the Data object as well, and the bean's setData method will try to override
the ID of the entity as well.. which is not allowed ("Embedded Exception A
CMP field that is a member of the primary key can only be set in ejbCreate
[EJB 2.0 Spec. 10.3.5].")

So seems I do need the primary key included in the data object, but I'd like
an abstract setData() method on the entity bean, which sets every field in
the data object, except the primary key.... As the primary key cannot be set
anyway after bean creation, that won't make any sense anyway - would it?

Or do I see something wrong here? 

Christopher

ps. maybe shall I write custom create() methods, which takes the whole data
object and construct the bean right from it? It'd solve the problem an other
way as I see..
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to