6 Replies Latest reply on Oct 1, 2005 1:26 PM by acoliver

    EJB3 vs Hibernate

      I am currently working on the new Message & Mailbox persistance code. Since moving to JDK5 I have run into a problem with XDoclet that it chokes on code that uses generics. This leaves me with a couple of options:

      1. Don't use any JDK5 language features and keep using XDoclet for generation of hibernate XML metadata.

      2. Use JDK5 language features and write all of the XML metadata by hand.

      3. Switch to EJB3 and use JDK Annotations for metadata.

      My personal perference would actually be to go to EJB3 given we have already moved to JDK 5. I would like to use the new JDK5 language features and I detest writing XML metadata. The eventual plan was to use EJB3 so doing it now would save a rewrite from Hibernate to EJB3 in the future.

      Options? Thoughts? Questions?

      Regards,
      Mike.

        • 1. Re: EJB3 vs Hibernate
          acoliver

          Switch to go to EJB3 for the persistance stuff/session bean type stuff. However still use XML for wiring of stuff like the MBeans as these are reconfigurable. It would be good to decouple table/field names from the EJBs and put those in XML because it is likely that some places will change their names for different reasons.

          • 2. Re: EJB3 vs Hibernate
            pilhuhn

            Actually, just put the defaults in the annotations. Overriding in DDs later on is still possible.

            • 3. Re: EJB3 vs Hibernate
              pilhuhn

               

              "mikezzz" wrote:
              I am currently working on the new Message & Mailbox persistance code. Since moving to JDK5 I have run into a problem with XDoclet that it chokes on code that uses generics.

              There is a xjavadoc 1.5 module, that can be (iirc) dropped in Xdoclet to replace the old xjavadoc 1.1 and which understands the JDK 5 features.


              • 4. Re: EJB3 vs Hibernate
                acoliver

                "Actually, just put the defaults in the annotations. Overriding in DDs later on is still possible."

                As long as it doesn't obfuscate it for your average sysadmin type then that is fine.

                "There is a xjavadoc 1.5 module, that can be (iirc) dropped in Xdoclet to replace the old xjavadoc 1.1 and which understands the JDK 5 features."

                My opinion is "Lets just EJB3 it and be done. The HAR deployer is a dead end anyhow.", but I do not feel strongly about it.

                • 5. Re: EJB3 vs Hibernate

                   

                  Lets just EJB3 it and be done


                  My sentiments exactly. I'll probably just use the entity stuff initially and see how it goes.

                  • 6. Re: EJB3 vs Hibernate
                    acoliver

                    It may actually (now that I think of it) make sense to use Jboss (EJB3 extension) "Service" beans instead of MBeans then do the wiring and config from XML.. That might simplify config. I'll think on it some more...