hi jason.

actually, i'm doing a similar approach, using interfaces and factories for the entities. you will need to cast the entity interfaces to their implementation counterparts in the database methods. i believe that the entity classes need to have a public no-args constructors in order for castor to "re-create" the entity when retrieved from the database.



At 12:52 03/01/12 +0100, you wrote:
Hi,

I have a User object which I wish to make immutable. I have the following:

A User interface which defines a lot of get methods for user attributes.
A UserImpl which implements the User interface plus all the set methods.
I give the UserImpl class package level scope so that it can be created only by a UserFactory class.

Now what steps are involved if I want to make UserImpl persistent with Castor? Specifically what is needed in the mapping file to use the UserFactory.createUser method If I use JDO code e.g. the Database object does that also have to live with the UserFactory i.e. will I need to cast User interfaces to UserImpl objects in the Database methods? Any advice is greatly appreciated.

Thanks, Jason

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

Reply via email to