7 Replies Latest reply on May 18, 2005 4:56 AM by herkules

    hibernate.properties

    herkules

      Hi,

      I tried to use hibernate.properties file to override the hibernate.hbm2ddl.auto property. The file is placed in the root folder of ejb3 jar. However JBoss still uses the defaults from ejb3.deployer\META-INF\hibernate.properties. I have JBoss jboss-4.0.1sp1 and EJB-3.0_Preview_5.

      Does it work for you?

      Thanks, Jan

        • 1. Re: hibernate.properties
          bill.burke

          You have to place hibernate.properties of the META-INF/ dir of your JAR. Same if you used hibernate.cfg.xml.

          xxx.hbm.xml files can be anywhere in the jar though.

          • 2. Re: hibernate.properties
            herkules

            Thanks for answer, I tried with the file in META-INF older, but it doesn't work too.

            The EJB 3.0 reference says: "Place hibernate.properties in a root directory of the classpath". Is there an error in the documentation?

            Jan

            • 3. Re: hibernate.properties
              bill.burke

              can you point out the error in the doco here?

              it is surprising that putting the hibernate.properties in the META-INF of the jar file doesn't work....

              • 4. Re: hibernate.properties
                herkules

                Yes: docs\Hibernate3\reference\en\html\session-configuration.html, chapter 3.1 "Place hibernate.properties in a root directory of the classpath. "

                Jan

                • 5. Re: hibernate.properties
                  herkules

                  Indeed ti works fine when placed in META-INF folder. Just the documentation is not correct.

                  Thanks, Jan

                  • 6. Re: hibernate.properties
                    any_key

                     

                    "Herkules" wrote:
                    Yes: docs\Hibernate3\reference\en\html\session-configuration.html, chapter 3.1 "Place hibernate.properties in a root directory of the classpath. "

                    Jan


                    It's Hibernate3 docs. Not EJB3.
                    For Hibernate You must place hibernate.properties in a root directory of the classpath.
                    For ejb3 place it in the META-INF directory of the jar file.

                    • 7. Re: hibernate.properties
                      herkules

                      Now it's clear to me, the EJB newbie.

                      Thanks.