Cayenne has a concept of relationship that addresses exactly this case - a
to-one or to-many "link" between DataObjects of different entities. This
is supported via the Modeler (see relationship tab for ObjEntity).
ObjRelationships map to DbRelationships of DbEntities, i.e. db PK/FK
joins.
On most databases (except for MySQL) you get the releationships mapped
automatically during reverse-engineering if the database constraints are
defined properly in the schema.
Andrus
> Hi,
> another question:
> is possible to fill a bean (data object) made in this manner:
> ----------------------------------------------------------
> public class MyTypeImpl extends
> org.objectstyle.cayenne.CayenneDataObject {
>
> public String getMySimpleField()
> {
> return (String) readProperty("MySimpleField");
> }
>
> public void setMySimpleField(String mySimpleFieldValue) {
> writeProperty("MySimpleField", mySimpleFieldValue);
> }
>
> //HERE THE PROBLEM
> public MyType2Impl getMyType2Field()
> {
> return (MyType2Impl) readProperty("MyType2Field");
> }
>
> public void setMyType2Impl(MyType2Impl myType2FieldValue) {
> writeProperty("MyType2Field", myType2FieldValue);
> }
>
>
> }
> ----------------------------------------------------------
> where "MyTypeImpl" and "MyType2Impl" are CayenneDataObject.
> How i map this to my datamap xml file?
>
> Thank's
> Davide
This archive was generated by hypermail 2.0.0 : Fri Jan 21 2005 - 09:43:01 EST