-->
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.  [ 6 posts ] 
Author Message
 Post subject: how to generate Java-Pojos from hbm-files ?
PostPosted: Mon Aug 22, 2005 11:49 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
According to my understanding the hbm2java-tools from hibernate-tools are made to generate Pojos on the basis of a jdbcconfiguration, that is reverse enginereering database-metadata. This is what I read from the tools-docs.
Or is this wrong?

What I need is a "real" hbm2java: generate java-Pojos from a set of hbm-files. Additionally I need to specify a "strategy" and custom templates to render the java-code. Either from Eclipse console OR as ant task.

Can someone advise me if this is possible and where appropriate docs are located.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 12:05 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Yes, it's possible, both from Ant and from the Eclipse plugins. http://www.hibernate.org/hib_docs/tools/


Top
 Profile  
 
 Post subject: how to pass set of hbm-files as ressource for hbm2java
PostPosted: Mon Aug 22, 2005 12:24 pm 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
this is what I referred to, of course.

Ok, but it says I need to pass a hibernate.cfg.xml.
Is it possible to specify there a set of hbm-files which will be rendered to Java-Pojos? Or how else do I pass the hbm-files as a resource?





nathanmoon wrote:
Yes, it's possible, both from Ant and from the Eclipse plugins. http://www.hibernate.org/hib_docs/tools/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 12:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh - what is wrong with listing the mappings in your cfg.xml or simply use ant and use a fileset ?

And yes, hbm2java can generate code from a JDBCConfiguration but it can do the same for a normal Configuraiton and a AnnotationConfiguration....polymorphism you know ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 5:41 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
max wrote:
eh - what is wrong with listing the mappings in your cfg.xml or simply use ant and use a fileset ?

And yes, hbm2java can generate code from a JDBCConfiguration but it can do the same for a normal Configuraiton and a AnnotationConfiguration....polymorphism you know ;)


well, I tried to pass the hbm like this

<mapping resource="Aufbau.hbm.xml"/>

but then I ran into trouble with the path. It can't find the file
What is the reference directory that is used to find the resource?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 5:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
a resource is not a file - they are looked up via the classpath

_________________
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.  [ 6 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.