What is wrong with this markup. I've followed your advice and allowed
xdoclet to generate a table for the persistent base class (even though
the fields are in each concrete classes table), but this fails to
produce *any* fields in the repository. Do I really have to duplicate
each @ojb.field tag FIVE times for each property?
BTW, I am using xdoclet-1.2.1, xdoclet-ojb-module-1.2.1, and
xjavadoc-1.0.3 from CVS.
Any other suggestions?
/**
* @ojb.class
*/
public interface PersistentObject {
/*
* @ojb.field column="ID"
* jdbc-type="INTEGER"
* primarykey="true"
*/
public Integer getId();
/*
* @ojb.field column="ID"
* jdbc-type="INTEGER"
* primarykey="true"
*/
public void setId(Integer id);
...
}
/**
* @ojb.class
*/
public abstract class PersistentObjectImpl implements PersistentObject {
/*
* @ojb.field column="ID"
* jdbc-type="INTEGER"
* primarykey="true"
*/
protected Integer id;
/*
* @ojb.field column="ID"
* jdbc-type="INTEGER"
* primarykey="true"
*/
public Integer getId() { return id; }
/*
* @ojb.field column="ID"
* jdbc-type="INTEGER"
* primarykey="true"
*/
public void setId(Integer id) { this.id = id; }
...
}
/**
* @ojb.class
*/
public interface ReportParameterValue extends PersistentObject {
/*
* @ojb.field column="ParameterValue"
*/
public String getValue();
/*
* @ojb.field column="ParameterValue"
*/
public void setValue(String value);
}
/**
* @ojb.class table="tblRptReportParameterValue"
* @ojb.field name="reportParameterID"
* column="ReportParameterID"
* jdbc-type="INTEGER"
*/
public class ReportParameterValueImpl extends PersistentObjectImpl
implements ReportParameterValue {
/*
* @ojb.field column="ParameterValue"
*/
protected String value;
...
/*
* @ojb.field column="ParameterValue"
*/
public String getValue() { return value; }
/*
* @ojb.field column="ParameterValue"
*/
public void setValue(String value) { this.value = value; }
}
This is the repository it produces:
<!-- file containing the repository descriptions for user-defined types
-->
<!-- Generated by the xdoclet-ojb module -->
<class-descriptor
class="uwec.fpm.persistence.PersistentObject"
table="PersistentObject"
>
<extent-class
class-ref="uwec.fpm.persistence.PersistentObjectImpl"/>
<extent-class
class-ref="uwec.fpm.persistence.report.ReportParameterValue"/>
</class-descriptor>
<class-descriptor
class="uwec.fpm.persistence.PersistentObjectImpl"
table="PersistentObjectImpl"
>
<extent-class
class-ref="uwec.fpm.persistence.report.ReportParameterValueImpl"/>
</class-descriptor>
<class-descriptor
class="uwec.fpm.persistence.report.ReportParameterValue"
table="ReportParameterValue"
>
<extent-class
class-ref="uwec.fpm.persistence.report.ReportParameterValueImpl"/>
</class-descriptor>
<class-descriptor
class="uwec.fpm.persistence.report.ReportParameterValueImpl"
table="tblRptReportParameterValue"
>
<field-descriptor
name="reportParameterID"
column="ReportParameterID"
jdbc-type="INTEGER"
access="anonymous"
>
</field-descriptor>
</class-descriptor>
-----Original Message-----
From: Thomas Dudziak [mailto:[EMAIL PROTECTED]
Sent: Monday, November 15, 2004 6:09 PM
To: OJB Users List
Subject: Re: How to markup for xdoclet inheritance structure?
Gelhar, Wallace Joseph wrote:
> I am trying to use xdoclet to map an inheritance hierarchy as follows,
> but it fails to include any inherited fields. Any ideas?
The generate-table-info="false" setting disables generation of
field/reference/collection entries. See here for details:
http://db.apache.org/ojb/docu/guides/xdoclet-module.html#ojb.class
You should also put the ojb.field tags at the getter or setter methods
in the interfaces because this will cause their definition to be
inherited in all implementing classes.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]