-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: need a good xdoclet tutorial
PostPosted: Sat Mar 26, 2005 3:40 pm 
Newbie

Joined: Mon Sep 06, 2004 1:39 pm
Posts: 18
Location: Utah, USA
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!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 7:50 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
XDoclet is searching for @hibernate.id which should be declared at the getId() method.

_________________
regards

Olaf

vote if it helped


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.