Hello there.
I have classes setup like in the example for Classes on Multiple Joined Tables.
But, I have a "C" class.


public class A
{
   // id is A.A_ID
   private Integer id;
   private String aValue;
}
public class B extends A
{
   // id is B.B_ID
   private Integer id;
   // aID is A.A_ID
   private Integer aID;
   private Integer bValue;
}
public class C extends B
{
   // id is mapped to B_ID
   private Integer id;
   private String cValue;
}

Criteria crit = new Criteria();
crit.addEqualTo( "cValue", "blah" );
Query q = QueryFactory.newQuery( C.class, crit );
Collection coll = broker.getCollectionByQuery( q );

All of this seems to work perfectly.  Its only when I go to access elements
that I get problems.

Iterator it = coll.iterator();
while( it.hasNext() )
{
   C myC = (C)it.next();
   System.out.println( "C.cValue: " + myC.getCValue() );
   System.out.println( "C.bValue: " + myC.getBValue() );
   System.out.println( "C.aValue: " + myC.getAValue() );
}

The first two print correctly but the third one is always "null". There is no
error when comiling, because they all "extend" correctly. So why is the last value
always null. Has anyone else done this before? Is there something I should be
doing differently in my repository.xml?


This all relates to an question I asked earlier today, am I allowed to join tables
at values that are not the "id". Thanks a lot.



Charlie



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to