-->
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.  [ 3 posts ] 
Author Message
 Post subject: xdoclet not adding index tag for list map
PostPosted: Wed Aug 17, 2005 12:46 pm 
Newbie

Joined: Wed Aug 17, 2005 12:35 pm
Posts: 5
Hi,

is anybody experiencing this?
I've a "Person" class and managing hibernate persistance through xdoclet, the only problem I'm having is with a list mapping:

Code:

/**
* Returns person address list

* @hibernate.list table="person_address" cascade="all" lazy="false"
* @hibernate.collection-key column="person_id"
* @hibernate.collection-index="address_index"
* @hibernate.collection-one-to-many class="Address"
*
*/
public List getAddresses() {
      
    return this.addresses;
      
}




When I run the hibernatedoclet task in my ant target xdoclet stops giving this error:

Code:
The content of element type "list" must match "(meta*,subselect?,cache?,synchronize*,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)".


in fact the generated Person.hbm.xml does not contain the index element that should indicate the list order in the list association table (but I do have written my @hibernate.collection-index annotation!)

Is it an xdoclet issue (it's strange that I could not find any other people having had the same problem online...) or I'm doing something wrong?

I'm using xdoclet 1.2.3, hibernate 3.0.5 and ant 1.6.5

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 6:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Create a simple example and post it the XDoclets JIRA.
BTW: Xdoclet CVS version has lots of changes and enhancements for H3


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 7:57 pm 
Newbie

Joined: Wed Aug 17, 2005 12:35 pm
Posts: 5
ok, I'll do it but while I confirm the strange behaviour I reported above now I get the same error from schemaexport with an xml mapping file done by hand that (for the list part) is like this:

Code:

<list name="addresses" table="person_address" lazy="false" cascade="all">
    <key column="person_id"/>
    <one-to-many class="Address"/>
    <list-index   column="address_index"/>
</list>



This is the dump of ant output (same error as above!)...


Code:

[propertyfile] Creating new property file: C:\Documents and Settings\[...]database.properties
[schemaexport] (cfg.Environment                     464 ) Hibernate 3.0.5
[schemaexport] (cfg.Environment                     477 ) hibernate.properties not found
[schemaexport] (cfg.Environment                     510 ) using CGLIB reflection optimizer
[schemaexport] (cfg.Environment                     540 ) using JDK 1.4 java.sql.Timestamp handling
[schemaexport] (cfg.Configuration                   223 ) Mapping file: C:\Documents and Settings\[...]\Person.hbm.xml
[schemaexport] (util.XMLHelper                      59  ) Error parsing XML: C:\Documents and Settings\[...]\Person.hbm.xml(90) The content of element type "list" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)".
[schemaexport] (cfg.Configuration                   232 ) Could not configure datastore from file: C:\Documents and Settings\[...]\Person.hbm.xml
[schemaexport] org.hibernate.MappingException: invalid mapping
[schemaexport] at org.hibernate.cfg.Configuration.addFile(Configuration.java:227)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[schemaexport] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[schemaexport] Caused by: org.xml.sax.SAXParseException: The content of element type "list" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)".
[schemaexport] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
[schemaexport] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
[schemaexport] at org.dom4j.io.SAXReader.read(SAXReader.java:465)
[schemaexport] at org.dom4j.io.SAXReader.read(SAXReader.java:264)
[schemaexport] at org.hibernate.cfg.Configuration.addFile(Configuration.java:226)
[schemaexport] ... 13 more


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