-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate xdoclet annotation
PostPosted: Mon Aug 07, 2006 11:15 pm 
Newbie

Joined: Mon Aug 07, 2006 7:14 pm
Posts: 16
[b]Hibernate version:3.1[/b]

[b]Full stack trace of any exception that occurs:[hibernatedoclet] org.xml.sax.SAXParseException: Attribute "lazy" with value "extra" must have a value from the list "true false ".
[hibernatedoclet] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[hibernatedoclet] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.validateDTDattribute(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[hibernatedoclet] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[hibernatedoclet] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[hibernatedoclet] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[hibernatedoclet] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[hibernatedoclet] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[hibernatedoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:271)
[hibernatedoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:221)
[hibernatedoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:310)
[hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:575)
[hibernatedoclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:802)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:690)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:607)
[hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:249)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:137)
[hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:49)
[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.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatedoclet] D:\_eclipse_wks\myApp\build.xml:289: 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.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatedoclet] Caused by: xdoclet.XDocletException: Generated file [file:D:/_eclipse_wks/myApp/build/dao/gen/com/myPackage/model/MyPojo.hbm.xml:line 85] Message=[Attribute "lazy" with value "extra" must have a value from the list "true false ".] is not valid according to its DTD or XML Schema. This might be due to some missing tags in your source.
[hibernatedoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:277)
[hibernatedoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:221)
[hibernatedoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:310)
[hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:575)
[hibernatedoclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:802)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:690)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:607)
[hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:249)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:137)
[hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:49)
[hibernatedoclet] at xdoclet.DocletTask.start(DocletTask.java:468)
[hibernatedoclet] ... 12 more
[hibernatedoclet] --- Nested Exception ---
[hibernatedoclet] xdoclet.XDocletException: Generated file [file:D:/_eclipse_wks/myApp/build/dao/gen/com/myPackage/model/MyPojo.hbm.xml:line 85] Message=[Attribute "lazy" with value "extra" must have a value from the list "true false ".] is not valid according to its DTD or XML Schema. This might be due to some missing tags in your source.
[hibernatedoclet] at xdoclet.util.XmlValidator.doValidate(XmlValidator.java:277)
[hibernatedoclet] at xdoclet.util.XmlValidator.validate(XmlValidator.java:221)
[hibernatedoclet] at xdoclet.XmlSubTask.engineFinished(XmlSubTask.java:310)
[hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:575)
[hibernatedoclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:802)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:690)
[hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:607)
[hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:249)
[hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:137)
[hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:49)
[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.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[/b]


Hello all.
I have a problem with the automatic xdoclet generation of hbm files. Xdoclet does not recognize the extra option of lazy collection property.
I need that option because the collection is very large and in some cases I only need to get the collection size (sql count() agg function).
I'm working with appfuse, spring and hibernate and I have an Ant build file that automatically generate the hbm based on Pojo's annotation and deploy the application in Tomcat, but I can't work if xdoclet dos not support the extra option.
Anybody could help me with this problem?

thanks in advance.


Posted: Tue Aug 08, 2006 12:17 am Post subject:

Firstly - this should be posted in the tools forum.
Secondly - what version of XDoclet are you using? and it is configured for H3.0, eg, setting the version attribute.
Thirdly - its a good idea to show a small sample of the hbm output and your XDoclet markup.


Top
 Profile  
 
 Post subject: Hibernate xdoclet annotation
PostPosted: Mon Aug 07, 2006 11:36 pm 
Newbie

Joined: Mon Aug 07, 2006 7:14 pm
Posts: 16
David:

Secondly: I try with xdoclet-1.3-SNAPSHOT (it comes with AppFuse) and with 1.2.3.
Configuration of hibernate version:
hibernate.version=3.1.3
this line is in lib.properties and it's used by ant when executes the build.xml.

Thirdly:

these are the annotations:

/**
* @author User
*
*@hibernate.class table="person"
*/
public class Person
private Set parts= new HashSet();
...

/**
* @hibernate.set table="part" cascade="save-update" lazy="extra" inverse="true"
* @hibernate.collection-key column="person_id"
* @hibernate.collection-one-to-many class="org.appfuse.model.Part" column="part_id"
*
*/

but the hbm file does not generate, because xdoclet expects the values true/false in lazy property and there are a SAXParseException when I try to generate the hbm.
I think that it's a xdoclet issue, i see the xtags.xml file and the lazy property is declared as a boolean, so xdoclet really does not have full support for hibernate 3.1.
I also see xdoclet hibernate tag reference and i don't find the extra value for lazy collection property.

am I doing something wrong?

what could i do?,
thanks for your help.


Top
 Profile  
 
 Post subject: xdoclet problem with lazy property
PostPosted: Tue Aug 08, 2006 7:57 pm 
Newbie

Joined: Mon Aug 07, 2006 7:14 pm
Posts: 16
please could anybody help me with this problem, it seems that xdoclet does not recognize the extra value for lazy collection property.
lazy = "true/false/extra". Xdoclet only expects "true/false".

thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 8:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I had a quick look at the xdoclet 1.3 source and can confirm that at appears this level of support has not been implemented for it as yet. Its not a difficult change it I suggest you make the change to the xdoclet source and them submit it to xdoclets Jira. If you cannot so that then atleast create the Jira request. I may get around to making the changes but not until I finish an Oracle dialect for the tools reverse generator. There are other active commiters on xdoclet that may take it up for you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 11:47 am 
Newbie

Joined: Mon Aug 07, 2006 7:14 pm
Posts: 16
ok David, thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.