Hi,
I having a trouble with XDoclet to determine use of Multiple Joined Tables, If I had a reference in superclass the anonymous field for this reference is replicated, in generated subclass descriptor.
For example, if I attempt to query any Motorcycle, I get a Unknown column name: MY_MANUFACTURER from Database, because the anonymous field
is replicated on Motorcycle descriptor, if include in Motorcycle class:
* @ojb.modify-inherited ignore="true" name="myManufacturer"
The reference declaration goes out from motorcycle descriptor, but anonymous field no, then if include:
* @ojb.modify-inherited ignore="true" name="myManufacturerOid"
I get the follow exception when generating descriptors with ant:
[ojbdoclet] SEVERE: The reference myManufacturer in the class Motorcycle uses the field myManufacturerOid as foreignkey although this field is ignored in this class
But I need to maintain reference if I need to Query all Motorcycle from a specific Manufacturer.
I can do this work, only, removing generated anonymous field from descriptor, but this invalidadtes use of XDoclet, then how I can do
this mapping using XDoclet without manually changing generated mapping?
ps: below are classes for better understanding.
Best regards
Clóvis
---------START OF CLASS DEFINITIONS---------------------
/**
* @ojb.class table="PERSON"
* determine-extents="false"
**/
public class Person {
/**
* @ojb.field column="OID"
* length="8"
* primarykey="true"
**/
public String oid;
/**
* @ojb.field column="VERSION"
* locking="true"
**/
public int version;
/** * @ojb.field column="SHORTCUT" * length="20" **/ String shortcut;
/** * @ojb.field column="NAME" * length="40" **/ String name;
}
/**
* @ojb.class table="PRODUCT"
* determine-extents="false"
* @ojb.field name="myManufacturerOid"
* column="MY_MANUFACTURER"
* jdbc-type="VARCHAR"
* length="8"
**/
public class Product {
/**
* @ojb.field column="OID"
* length="8"
* primarykey="true"
**/
public String oid;
/**
* @ojb.field column="VERSION"
* locking="true"
**/
public int version;
/** * @ojb.field column="NAME" * length="40" **/ String name;
/** * @ojb.reference foreignkey="myManufacturerOid" **/ Person myManufacturer; }
/** * @ojb.class table="MOTORCYCLE" * @ojb.modify-inherited ignore="true" name="version" * @ojb.modify-inherited ignore="true" name="name" * @ojb.reference class-ref="Product" * foreignkey="oid" * auto-retrieve="true" * auto-update="object" * auto-delete="object" **/ public class Motorcycle extends Product {
/**
* @ojb.field column="CHASSIS" * length="20"
**/
String chassis;
}
---------END OF CLASS DEFINITIONS---------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]