3 Replies Latest reply on Jan 13, 2010 9:29 AM by Arvind Tiwari

    HowToUse seam-gen to reverse engineer multiple databases

    Arvind Tiwari Newbie

      Hi There,


      Apologies, if this question has already been answered in some existing topic. I tried googling but could not find any post for the working solution!!


      I am a newbie to Seam and have been exploring it for use in my current project. I need to build a UI which will dynamically connect to multiple MySQL database schema's.


      Is it possible to use seam-gen to reverse engineer and generate pages for more than one MySQL database schema simultaneously?


      If yes, can someone tell me the exact steps to be followed/modifications required so that seam-gen (either command line or using JBoss-Tools) can setup the initial working UI using more than one databases?


      Many thanks for helping me out!


        • 1. Re: HowToUse seam-gen to reverse engineer multiple databases
          Arvind Tiwari Newbie

          Arvind Tiwari wrote on Jan 11, 2010 09:06:


          Hi There,

          Apologies, if this question has already been answered in some existing topic. I tried googling but could not find any post for the working solution!!

          I am a newbie to Seam and have been exploring it for use in my current project. I need to build a UI which will dynamically connect to multiple MySQL database schema's.

          Is it possible to use seam-gen to reverse engineer and generate pages for more than one MySQL database schema simultaneously?

          If yes, can someone tell me the exact steps to be followed/modifications required so that seam-gen (either command line or using JBoss-Tools) can setup the initial working UI using more than one databases?

          Many thanks for helping me out!




          To add to my previous query, here are the steps that I am following:


          1. Assuming that I want Seam to reverse engineer and generate UI for two MySQL schemas - EMP (primary) and HR.


          2. Run seam-gen setup providing information about primary datasource, connection url etc.


          3. Run seam-gen create-project and seam-gen generate-entities using the above configurations.


          4. Now add another datasource in *-ds.xml.


          5. Create one more persistence unit corresponding to new datasource (HR) in persistence-*.xml


          6. Add persistence-managed-context information in components.xml



          7. Create new entity converter in components.xml


          8. Re-run seam-gen using command  seam-gen generate-entities restart.


          On step 8, I am getting exception [hibernate]org.hibernate.exception.JDBCConnectionException: Getting database metadata


          Can some one provide a clue as to where I am going wrong?
          Also, whether this is the right approach to tackle multiple database issue or is there some better/efficient way to achieve the same?


          TIA for helping me out!


          • 2. Re: HowToUse seam-gen to reverse engineer multiple databases
            Arvind Tiwari Newbie

            Well, finally I have been able to connect to two databases and make my demo application functional!


            I would highly recommend reading the post http://www.seamframework.org/Community/MultipleDatasourcesAndPersistenceUnits if anyone else is also facing similar issue!



            Thanks for all the help and posts!
            :)


            • 3. Re: HowToUse seam-gen to reverse engineer multiple databases
              Arvind Tiwari Newbie

              Well, finally I have been able to connect to two databases and make my demo application functional!


              I would highly recommend reading the post http://www.seamframework.org/Community/MultipleDatasourcesAndPersistenceUnits if anyone else is also facing similar issue!



              Thanks for all the help and posts!
              :)