-->
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.  [ 8 posts ] 
Author Message
 Post subject: hbm2java ignoring implements attribute
PostPosted: Mon Jan 10, 2005 8:15 pm 
Newbie

Joined: Mon Dec 06, 2004 5:40 pm
Posts: 5
It seems that hbm2java is ignoring my config file. The ant task is:

<target name="hbm2java" description="Generate .java from .hbm files.">
<hbm2java output="${build.gen-src.dir}" config="${basedir}/hib-config.xml">
<fileset dir="${build.gen-src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>

The config file it references is:

<codegen>
<meta attribute="implements">org.data.ValueObject</meta>
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
</codegen>

When I look at the code that is generated though it never has the implements with my changes:

public class Program implements Serializable {...

I know that it is reading the file because I have changed this line:
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>

to

<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer.Foo"/>

and it complains that it can't find my class.

Should I be doing something different to have it pickup the interface I want it to implement?

I am using Hibernate 2.1 and the hibernate-tools that came with it.

Thanks,

Bryan

Hibernate version: 2.1.7

Mapping documents:none

Code between sessionFactory.openSession() and session.close():none

Full stack trace of any exception that occurs:none

Name and version of the database you are using:Oracle 9.2.0.1.0

The generated SQL (show_sql=true):none

Debug level Hibernate log excerpt:none


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 10, 2005 8:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The meta element has to be in the mapping file.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 10, 2005 8:39 pm 
Newbie

Joined: Mon Dec 06, 2004 5:40 pm
Posts: 5
So it won't pick it up from the config file while generating it? Do I need to just use regex to put it in the mapping files?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 1:16 am 
Newbie

Joined: Mon Dec 06, 2004 5:40 pm
Posts: 5
I have looked through the dtd for where to define the interface in the hibernate mapping files and can't see where to define it. Am I misinterpreting what you mean by mapping file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 3:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
actually hbm2java in H2 extensions should actually also pick it up from the config file.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 7:17 pm 
Newbie

Joined: Mon Dec 06, 2004 5:40 pm
Posts: 5
So I am still confused then, does it look like I am missing something out of my config file?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 4:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - i can't reproduce it ... it works here with hibernateext-2.1.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 1:37 pm 
Newbie

Joined: Mon Dec 06, 2004 5:40 pm
Posts: 5
It looks like I didn't have the latest version of the hibernate-tools.jar. I downloaded it and it works as expected now. Thanks!


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