-->
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.  [ 9 posts ] 
Author Message
 Post subject: Using hbm2jave in eclipse
PostPosted: Sat Jul 29, 2006 10:24 pm 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
Newbie here and I can't find the documentation on hbm2java with eclipse 3.2 and the beta6 tools. I am trying to just have it generate java code from one hbm.xml file. I get an exception on another file that for some reason it thinks should be in folder X, where it actually lives in folder Y.

If anyone can point me to some documentation or tell me where the Hibernate Code Generation info is stored under eclipse, that would be great.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 30, 2006 9:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what is the error ?

And what is it specifically you want when asking for "Hibernate Code Generaiton info" ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 30, 2006 9:28 pm 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
max wrote:
what is the error ?

And what is it specifically you want when asking for "Hibernate Code Generaiton info" ?


This is the error:

org.hibernate.console.HibernateConsoleRuntimeException: Could not resolve /hibernate/src/main/java/com/hp/ov/persist/shareddb/Code.hbm.xml to a file
<No message>

Which is correct because the xml file lives under shareddb/mappings.

I was guessing that the Hibernate Code Generation information is stored somewhere under the eclipse workspace folder hierarchy and that somehow it has the incorrect path stored.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 12:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Could you give me the full stacktrace ? (available in the Error Log view).

Did you by any chance enter /hibernate/src/main/java/com/hp/ov/persist/shareddb/ into the package name when doing reverse engineering and then chose to generate a hibernate.cfg.xml ?
Then this filename would be generated into the hibernate.cfg.xml since it is the "normalized" form of mapping file names.

And no, there isn't any "extra" path names stored anywhere besides what you can see in the launcherconfiguration and you ordinary hibernate configuration files.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 10:45 am 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
max wrote:
Could you give me the full stacktrace ? (available in the Error Log view).

Did you by any chance enter /hibernate/src/main/java/com/hp/ov/persist/shareddb/ into the package name when doing reverse engineering and then chose to generate a hibernate.cfg.xml ?
Then this filename would be generated into the hibernate.cfg.xml since it is the "normalized" form of mapping file names.

And no, there isn't any "extra" path names stored anywhere besides what you can see in the launcherconfiguration and you ordinary hibernate configuration files.



Max, I double-checked the hibernate.cfg.xml file and there is no trace of the package name. Unfortunately there is no output at all in the Error Log view so I can't give you that, but I think that I found the reason: I do have a couple of manual created POJO's in the shareddb folder, my xml definitions live in shareddb/mappings. When I now manually copy over the hbm.xml file to where the pojo lives, it processes the file ok (and then bitches about the next one).

I will see if I can get ant to work.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
but somehow you have told hibernate to load those mapping files...it doesn't invent those names on its own ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 8:50 pm 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
max wrote:
but somehow you have told hibernate to load those mapping files...it doesn't invent those names on its own ;)


What, it doesn't, you gotta be kidding me :-)

I realize that so I am trying to find where and what file; I let you know if I figure it out.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 10:37 am 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
batter wrote:
max wrote:
but somehow you have told hibernate to load those mapping files...it doesn't invent those names on its own ;)


What, it doesn't, you gotta be kidding me :-)

I realize that so I am trying to find where and what file; I let you know if I figure it out.


After a looooong find/grep action I found the file(s) :

/workspace/hibernate/.metadata/.plugins/org.hibernate.eclipse.console

has a bunch of hibernate-console-x.xml files. All of them have a mappings section where hbm.xml files were put under shareddb and not shareddb/mappings. It seems they get generated the first time you run the code generation; what it uses to generate these incorrect entries, I don't know


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 11:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
they are put there when you call "add mapping" in the console configuration.

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