-->
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.  [ 10 posts ] 
Author Message
 Post subject: Error: hbm2java doesn't support the "generics" att
PostPosted: Wed Jan 25, 2006 8:44 pm 
Newbie

Joined: Wed Jan 25, 2006 7:47 pm
Posts: 12
Hi,

I'm having a devil of a problem that I've spent the good part of 2 days troubleshooting. Background:

Hibernate3 (jar dated December 11, 2005)
Hibernate Tools 3.1.0 beta2
Ant 1.6.5
Eclipse 3.1.1 M2

Using an ant definition for HibernateToolTask, if I run hbm2java with an attribute of "generics=true", I get an immediate build error that "Hbm2JavaExporterTask doesn't support the 'generics' attribute". I'm using Ant within Eclipse's jvm, and in Ant's classpath I've included all the jars from the org.hibernate.eclipse3.1.0.beta2/lib subdirectories.

No one else on the web seems to have had this problem, but for the life of me I don't see what I'm doing wrong. The obvious suspect would be a classpath problem, but I'm able to generate anything else I want to.

Here's my ant target (may have typos - I can't cut & paste):

<target name="gen-java">
<hybtool destdir="${source.root}">
<configuration configurationfile=${source.root}/hibernate.cfg.xml/>
<hbm2java generics="true"/>
</hybtool>
</target>


Oh, and I should mention that I can't use the Artifact Generation wizard because I have a custom reverse naming strategy.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 2:42 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
you may want to double check the classpath and make sure there aren't any old HT distributions laying around.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the attribute generics have been replaced with the more correct jdk5="true" and in the newest release (part of jboss ide, but available as a seperate download) allows you to configure a custom namingstrategy in the ui.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:59 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
He says he is using 3.1.0 beta2.

Maybe http://www.hibernate.org/hib_docs/tools/ant/index.html should/should not have 3.1 beta 1 at the top ?

The docs link http://www.hibernate.org/5.html#A13 says 3.1 beta 2, and the linked resource ( http://www.hibernate.org/hib_docs/tools/ant/index.html ) says there is still a @generics.

oh, and @ signs are back BTW ;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm....weird, there should be beta2 docs there. in any case that will all be updated tomorrow ( i hope ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Works now
PostPosted: Thu Jan 26, 2006 1:05 pm 
Newbie

Joined: Wed Jan 25, 2006 7:47 pm
Posts: 12
Thanks Max. "jdk5=true" works. But I must say, I've read just about every document on the web with the word "hbm2java" in it, and I did not see that attribute anywhere.

And I am using beta2. Thanks again everyone!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 2:17 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
does hibernate-tools 2.x set support generics?

I got the h-tools 3 working, but it is still lacking in much of the functinoality that the 2.x toolset had

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 2:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ? what functionallity are you missing !?

and no, the 2.x toolset does not support generics.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 4:18 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
max wrote:
huh ? what functionallity are you missing !?

and no, the 2.x toolset does not support generics.


ok.

well I originally saw it wasn't making default equals/hashcode methods, but that's no problem, i just added in the meta attributes to do that.

my question is, does it handle the custom user types the same as before? I have my attributes declared like the following:

Code:
<key-property
            name="instidq"
            column="instidq"
            type="dars.apis.common.dao.hibernate.type.RightTrimmedStringUserType8"
            length="8"
        >
           <meta attribute="use-in-equals">true</meta>
            <meta attribute="property-type">java.lang.String</meta>
        </key-property>


btw, i do love the hibernate code generation wizard in the ecilpse plug-ins.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 4:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
default equals/hashcodes are bad - that is why h3 and latest h2 tools doesnt do it anymore.

and yes, usertypes will work perfectly - you of course just need to have them in the classpath so hbm2java can ask it what the return types are.
Nothing different between h2 and h3 tools there.

_________________
Max
Don't forget to rate


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