Hibernate version: 2.1.x
I am trying to use xdoclet to generate hibernate mapping files. My class structure is as follows:
Code:
public abstract class Persistent {
private Long id;
public Long getId() { }
public void setId(Long id) { }
}
/**
*
* @hibernate.class
* table="PARTY"
*/
public abstract class Party extends Persistent {
private String nameFirst;
...
public String getNameFirst() { }
public void setNameFirst(String nameFirst) { }
...
}
/**
* The Customer class.
*
* @hibernate.joined-subclass
* table="CUSTOMER"
* lazy="true"
*/
public class Customer extends org.simplecart.base.Party {
private String phone;
...
public String getPhone() { }
public void setPhone(String phone) { }
...
}
I want to end up with a Customer.hbm.xml mapping file, since Persistent and Party are abstract. How do I include the ID property with ID, when the getId() and setId() methods are in Persistent? I have followed a few tutorials, but can't quite get it.
Here is some of the stack trace:
[hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/>
[hibernatedoclet] Generating mapping file for org.simplecart.base.Party.
[hibernatedoclet] org.simplecart.base.Party
[hibernatedoclet] (XDocletMain.start 53 ) Running XDoclet failed.
[hibernatedoclet] (XDocletMain.start 54 ) <<Class org.simplecart.base.Party misses ID property>>
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\build.xml:80: XDoclet failed.
[hibernatedoclet] at xdoclet.DocletTask.start(DocletTask.java:471)
[hibernatedoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:105)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
[hibernatedoclet] Caused by: xdoclet.XDocletException: Class org.simplecart.base.Party misses ID property
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateTagsHandler.hasCompositeId_Impl(HibernateTagsHandler.java:668)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateTagsHandler.ifHasPrimitiveId(HibernateTagsHandler.java:211)
[hibernatedoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernatedoclet] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[hibernatedoclet] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[hibernatedoclet] at java.lang.reflect.Method.invoke(Unknown Source)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:638)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:564)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:962)
[hibernatedoclet] at xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:929)
[hibernatedoclet] at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:469)
[hibernatedoclet] at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:347)
[hibernatedoclet] at xdoclet.template.TemplateEngine.start(TemplateEngine.java:414)
[hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561)
[hibernatedoclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:778)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:678)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595)
[hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:201)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:123)
[hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:48)
[hibernatedoclet] at xdoclet.DocletTask.start(DocletTask.java:468)
[hibernatedoclet] ... 9 more
[hibernatedoclet] --- Nested Exception ---
[hibernatedoclet] xdoclet.XDocletException: Class org.simplecart.base.Party misses ID property
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateTagsHandler.hasCompositeId_Impl(HibernateTagsHandler.java:668)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateTagsHandler.ifHasPrimitiveId(HibernateTagsHandler.java:211)
[hibernatedoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernatedoclet] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[hibernatedoclet] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[hibernatedoclet] at java.lang.reflect.Method.invoke(Unknown Source)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:638)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:564)
[hibernatedoclet] at xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:962)
[hibernatedoclet] at xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:929)
[hibernatedoclet] at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:469)
[hibernatedoclet] at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:347)
[hibernatedoclet] at xdoclet.template.TemplateEngine.start(TemplateEngine.java:414)
[hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561)
[hibernatedoclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:778)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:678)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595)
[hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:201)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:123)
[hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:48)
[hibernatedoclet] at xdoclet.DocletTask.start(DocletTask.java:468)
[hibernatedoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:105)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
[hibernatedoclet] WARNING: Some classes refer to other classes that were not found among the sources or on the classpath.
[hibernatedoclet] (Perhaps the referred class doesn't exist? Hasn't been generated yet?)
[hibernatedoclet] The referring classes do not import any fully qualified classes matching these classes.
[hibernatedoclet] Since at least one package is imported, it is impossible for xjavadoc to figure out
[hibernatedoclet] what package the referred classes belong to. The classes are:
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\src\org\simplecart\webapp\actions\ProcessOrderAction.java --> Action qualified to org.simplecart.webapp.actions.Action
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\src\org\simplecart\webapp\actions\administration\AdministratorLoginAction.java --> Action qualified to org.simplecart.webapp.actions.administration.Action
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\src\org\simplecart\webapp\filters\AdministratorAuthFilter.java --> Filter qualified to org.simplecart.webapp.filters.Filter
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\src\org\simplecart\webapp\filters\CustomerAuthFilter.java --> Filter qualified to org.simplecart.webapp.filters.Filter
[hibernatedoclet] C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\src\org\simplecart\webapp\filters\MenuLoadFilter.java --> Filter qualified to org.simplecart.webapp.filters.Filter
BUILD FAILED: C:\Documents and Settings\Daniel\My Documents\work_from_home\simplecart\build.xml:80: Unexpected error
Total time: 7 seconds
Any help appreciated! Thanks!