-->
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.  [ 4 posts ] 
Author Message
 Post subject: scemaexport not working with use-in-tostring
PostPosted: Thu Jul 08, 2004 11:15 am 
Beginner
Beginner

Joined: Wed Jun 23, 2004 12:37 pm
Posts: 20
I'm trying to get the codegen tool to include the recipientList member in the toString() method. My mapping looks like this

<list name="recipientList" table="recipient_list">
<key column="message_id" />
<index column="position"/>
<element column="number" type="string" length="20" />
<meta attribute="use-in-tostring">true</meta>
</list>

Codegen works OK and creates the toString() method correctly but Schemaexport fails with:

[schemaexport] BUILD FAILED: file:C:/Projects/.../build.xml:45: Schema text failed: net.sf.hibernate.MappingException: invalid mapping

If I remove the meta attribribute scemaexport works.

Hib version 2.1.4
MySql 4.0.18


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 08, 2004 10:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Check the DTD for the list, eg, here it the section;

Code:
<!ELEMENT list (
   meta*,
   (cache|jcs-cache)?,
   key,
   index,
   (element|one-to-many|many-to-many|composite-element|many-to-any)
)>

See the meta tag is first. Move your meta tag to the top and try again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 4:33 am 
Beginner
Beginner

Joined: Wed Jun 23, 2004 12:37 pm
Posts: 20
That's fixed it.

Many thanks David.

I wonder why this doesn't cause a problem for codegen?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 6:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
hbm2java does not (currently) do a validating parse of the XML. I think thats reasonable as hibernate will catch the issues when you test the mapping.


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