-->
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 Tools with Ant - annotaions
PostPosted: Thu Sep 29, 2005 4:40 am 
Newbie

Joined: Thu Sep 29, 2005 4:30 am
Posts: 7
Hi all,

I am using Hibernate 3 along with the Hibernate Annotations.

Is it possible to use Hibernate Tools with Ant to generate Java code with annotations?

I know that it is possible to do this with Eclipse plugin but I can't find documentation how to do this with Ant.
I ask because I use Idea and not Eclipse and I really don't want to install Eclipse just for this (or maybe I will).

Thanks for any comment and help


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 6:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<hbm2java ejb3="true" ...>

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 5:06 am 
Newbie

Joined: Thu Sep 29, 2005 4:30 am
Posts: 7
Thanks and sorry for asking because this is writen in Hibernate Ant Tools documentation.

Now I tried to run ant task and I have other problems.
Quote:
org.hibernate.cfg.JDBCBinderException: The type java.lang.Object spans multiple columns. Only single column types allowed for single columns.

I saw many answers for this on forum, but nothing helped.
Problem is that I use Ant with Idea and I can't find solution how to debug ant.
I also run ant with -verbose and this is all I get from output, so I don't know with which table something is wrong and with which column.
I looked at the code from CVS where it is clear that you have fixed that,
but when I built jar and use it I get another problem
Quote:
java.lang.NoClassDefFoundError: org/hibernate/cfg/CollectionSecondPass
...
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:38)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:71)
...

I use this build.xml
Code:
<hibernatetool destdir="${basedir}/generated">
    <jdbcconfiguration
        packagename="net.energetika.data"
        propertyfile="hibernate.properties"
        revengfile="hibernate.reveng.xml"/>
    <hbm2java ejb3="true" generics="true" /> <!-- generate default .java files with EJB3 annotations -->
</hibernatetool>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 5:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to build the tool against H3.1 (should work with the latest release, but if it doesnt then use H3.1 from cvs)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 5:28 am 
Newbie

Joined: Thu Sep 29, 2005 4:30 am
Posts: 7
Thanks, it works now!
This new JDBCBinder helped me a lot!

Now I find my bug; I had defined two hibernate.connection.url!


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.