5 Replies Latest reply on May 19, 2009 11:37 PM by gavin.king

    Change EnityManager

    israel.bgf

      I want to override some methods of the EntityManager (using Hibernate). How exactly can i do that with Seam? Does it have to do with the @Install annotation?


      Thks


      Israel

        • 1. Re: Change EnityManager
          israel.bgf

          Any guidance?

          • 2. Re: Change EnityManager
            gonorrhea

            So I've never done what you're asking.  But I just downloaded hibernate-entitymanager-3.4.0.GA.zip and extracted it.  You can modify the source files that you need to modify and then build the JAR (there's a build.xml in the root).  Then replace the hibernate-entitymanager.jar in server/xxx/lib directory.


            Just my .02, there may be a better alternative but it seems to me this should work if you know which classes/methods to modify...


            • 3. Re: Change EnityManager
              gonorrhea

              note that JBoss may not support your projects/envmts if you do this...

              • 4. Re: Change EnityManager
                gavin.king

                You mean you want to wrap the Hibernate EntityManager in your own implementation of EntityManager, some kind of decorator?


                Then yes, the right way to do this is to write a component that extends one of the built-in Seam components and specify that it overrides the built-in implementation using @Install.

                • 5. Re: Change EnityManager
                  gavin.king

                  Arbi Sookazian wrote on May 19, 2009 22:39:


                  So I've never done what you're asking.  But I just downloaded hibernate-entitymanager-3.4.0.GA.zip and extracted it.  You can modify the source files that you need to modify and then build the JAR (there's a build.xml in the root).  Then replace the hibernate-entitymanager.jar in server/xxx/lib directory.

                  Just my .02, there may be a better alternative but it seems to me this should work if you know which classes/methods to modify...



                  That's a terrible way to do approach the problem.