hi!
it's wondering but I found out that its difficult to use interface driven design with ojb ;(
lets consider a simple 2-table example:
interface User{Integer getId(),Group getGroup()},
class UserImpl implements User{private Integer id; private Group group; access methods}
interface Group{Integer getId(),User getManager()},
class GroupImpl implements Group{private Integer id;privarte User manager; access methods}
What repository descriptor should be to get correct results with the following query:
QueryByCriteria query = QueryFactory.newQuery(User.class,new Criteria());
query.getCriteria().addEqualTo("group.manager.id",new Integer(4));
Collection users = broker.getCollectionByQuery(query);Standard approach in mapping is not working ;(
<class-descriptor class="test.ojb.datamodel.User">
<extent-class class-ref="test.ojb.datamodel.impl.UserImpl"/>
</class-descriptor>
<class-descriptor class="test.ojb.datamodel.impl.UserImpl" table="USER" factory-class="test.ojb.datamodel.impl.FactoryImpl"
factory-method="createUser">
<field-descriptor name="id" column="ID" jdbc-type="INTEGER"
primarykey="true"
nullable="false"
autoincrement="true"
access="readonly"/>
<field-descriptor name="groupId"
column="GROUP_ID"
jdbc-type="INTEGER"
access="anonymous"
/>
<reference-descriptor
name="group"
class-ref="test.ojb.datamodel.Group"
proxy="true"
>
<foreignkey field-ref="groupId"/>
</reference-descriptor>
</class-descriptor>
<class-descriptor class="test.ojb.datamodel.Group">
<extent-class class-ref="test.ojb.datamodel.impl.GroupImpl"/>
</class-descriptor>
<class-descriptor class="test.ojb.datamodel.impl.GroupImpl" table="GROUP1" factory-class="test.ojb.datamodel.impl.FactoryImpl"
factory-method="createGroup">
<field-descriptor name="id" column="ID" jdbc-type="INTEGER"
primarykey="true"
nullable="false"
autoincrement="true"
access="readonly"/>
<field-descriptor name="managerId"
column="MANAGER_ID"
jdbc-type="INTEGER"
access="anonymous"
/>
<reference-descriptor
name="manager"
class-ref="test.ojb.datamodel.User"
proxy="true"
>
<foreignkey field-ref="managerId"/>
</reference-descriptor>
</class-descriptor>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
