3 Replies Latest reply on Feb 16, 2007 9:59 AM by bytor99999

    Hibernate Tools Beta 9 JPA Persistence Unit


      So we have a persistence.xml but it points to a DataSource and will put the EntityManagerFactory into JNDI. So in order to get the DataSource, the app server would need to be running.

      Is there a way to config hibernate tools to use this persistence.xml without having to startup JBoss AS and get Eclipse to code complete for HQL etc?

      The configuration of Hibernate Tools can either have your browse and choose your hibernate.cfg.xml, if you have one, or type in a persistence unit name, not be able to browse and choose a persistence.xml.


        • 1. Re: Hibernate Tools Beta 9 JPA Persistence Unit

          It just seems like you need to have your database and app server running in order to get the EMF to be created to start developing and getting Code Completion. So you need to configure your project to point to the app server and to the database server. Correct?



          • 2. Re: Hibernate Tools Beta 9 JPA Persistence Unit
            Max Rydahl Andersen Master

            Currently you have to setup the connection properties in the persistence.xml (e.g. via hibernate.connection.* properties)

            In the next version we'll provide an option for selecting/specifying a set of connection properties that will be used to override what is in persistence.xml.

            I haven't actually tested it yet, but you should in theory be able to set the properties in a .properties file and point to in the console config. Just remember to have all the hibernate.connection.* set in there + set hibernate.datasource to the empty string (to "silence" the datasource specified in the persistence.xml)

            • 3. Re: Hibernate Tools Beta 9 JPA Persistence Unit

              Thanks Max,

              I put a request for something like this in JIRA. :)

              What would be cool, is being able to keep the persistence.xml exactly the way it is with a Data Source JNDI name, but in the console you can create a DataSource and give it a name that matches the JNDI name you gave in the persistence.xml and the console will use it.

              That would be cool. Matter of fact I should paste what I just wrote into the JIRA request I made, I don't think the way I wrote the request made sense. :)