-->
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: What does hibernate-console.properties file do?
PostPosted: Mon Aug 31, 2009 10:37 am 
Newbie

Joined: Wed Aug 26, 2009 11:35 am
Posts: 5
Hi. I've realized that the hibernate-console.properties file doesn't get deployed to our JBoss server and it seems to be used internally by Eclipse and Seam to generate entities from the database. Is this true? I've also realized that if the file isn't defined correctly, Eclipse can't connect to the database to perform any reverse-engineering tasks. It took some trial-and-error to discover this and wanted to double-check with the experts here. Thanks.


Top
 Profile  
 
 Post subject: Re: What does hibernate-console.properties file do?
PostPosted: Wed Sep 16, 2009 5:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Vitali, It's generated by our Seam wizard to ensure that users don't have to change their persistence.xml to let eclipse connect.

If hibernate-console.properties are incorrect its because the settings specified during the wizard was incorrect (at least that is where we get the info from).

What changes did you have to do ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: What does hibernate-console.properties file do?
PostPosted: Tue Sep 22, 2009 9:18 am 
Newbie

Joined: Wed Aug 26, 2009 11:35 am
Posts: 5
We had a JNDI file created by our server admin, and the key was to match the name of the JNDI (not the filename) in all the places it's referenced in Eclipse. This would enable our web apps to reference that one JNDI for the specific connection, instead of having multiple JNDI for each app. Eclipse doesn't allow the user (as far as I know) to choose the JNDI name itself; it gives a name to it based on the project. For example, in the persistence.xml file, it inserts this:

Code:
<jta-data-source>java:/project_nameDatasource</jta-data-source>


I used a tool called Agent Ransack to search my project folder and replace all the references to this name with the JNDI name on the server. I also had to clear the project and JBoss cache and ensure that the hibernate-console.properties file had the same connection info as the JNDI file on the server. This finally enabled the Eclipse "Seam Generate Entities" wizard to see the database and be able to reverse engineer its tables. It took almost a week of trial-and-error to figure out the purpose of the different files and get their settings right. Not an experience I'd ever, ever want to repeat. And during that time, I researched on Google for information countless times and came up with just little bits of info on what I was trying to do.


Top
 Profile  
 
 Post subject: Re: What does hibernate-console.properties file do?
PostPosted: Thu Sep 24, 2009 6:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
For the next time you are confused about where connection info are stroed, Eclipse have built-in search and replace :)

If we put a combobox for every possible combination we would have to have some very large wizards - changing datasource references should be trivial since it is only listed in one place afaik (persistence.xml) and any other connection info is reachable from the Hibernate console configuration dialog (here the hibernate-console.properties are referenced and accessible).

Not sure what we can do beyond what we have done today by allowing you to point to a DTP source which makes it possible to have just one ui for the connection info used by eclipse ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: What does hibernate-console.properties file do?
PostPosted: Thu Sep 24, 2009 8:22 am 
Newbie

Joined: Wed Aug 26, 2009 11:35 am
Posts: 5
Thanks, Max. Please don't get me wrong -- Hibernate is a very powerful tool and makes life so much easier. But for beginners, it can be a daunting challenge to understand all of it -- especially Eclipse/Seam beginners coming from the ASP.NET/Visual Studio environment.


Top
 Profile  
 
 Post subject: Re: What does hibernate-console.properties file do?
PostPosted: Tue Sep 29, 2009 12:50 pm 
Newbie

Joined: Wed Aug 26, 2009 11:35 am
Posts: 5
A followup: Where can I read a beginner's guide to Hibernate use in a Seam app? I'm trying to learn the syntax and how you fetch data in a Facelets page vs. in a Seam class file. Thanks.


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.