9 Replies Latest reply on May 16, 2008 10:21 AM by rogerwbmd

    Seam Generate Entities

    nsakiya

      Seam Generate Entities

      I'd like this take this opportunity to thank Max Andersen and the gangs at JBossWorld for hand-on lab. I was a Seam virgin there, but learn a lot from you guys. The lab was excellent, and everything works great.

      The problem I got here now is when I tried to adapt this and use my Oracle database. Using "Seam Generate Entity -> Reverse Engineer from Database" doesn't seem to work. I have like 100 tables in schema in the schema, and maybe they're causing the problem. The dialog box just sit there and got locked up after clicking Finish button. I wait for hours, but nothing changed or happened. I tried this in both Linux and Windows version, and they both seemed to stuck at the same place.

      If I may, I'd also like to suggest one thing in "Reverse Engineer from Database." It would be nice if we can pick and choose which tables and their dependend tables include instead of importing the entire schema.

      Thanks! :)

        • 1. Re: Seam Generate Entities
          nsakiya

          Well, is this a common problem everybody knows how to fix it or am I the only one here? Is there any other forums or web sites I might get more response on this issue? Any words on this would be really appreciated. Thanks!

          • 2. Re: Seam Generate Entities
            baz

            Hello,
            do i understand it correctly, 'Seam Generate Entities' does work for your databases, except for oracle?

            We have used it for generating entities out of our Oracle Express database.
            And we have it successfully used against Oracle 9.

            It was not an easy task for us to setup the database connection in a fully functinal way. But we succeded.

            In what i can remember, we have first tried to setup the oracle connection so that the 'hibernate' perspective does work in eclipse. In this perspective you get helpful information if something goes wrong.
            Ciao,
            Carsten

            • 3. Re: Seam Generate Entities
              maxandersen

              Hi guys,

              The trick with oracle is to remember to set hibernate.default_schema and maybe hibernate.default_catalog to limit which schemas we will read to the one you are interested in.

              We should have a better ui for selecting tables...right now we only have that if you use the Hibenrate tools code generation ui directly and create a reveng.xml file.

              • 4. Re: Seam Generate Entities
                maxandersen

                2 problems there:

                1) oracle does not have catalogs so don't set it.

                2) oracle is casesensitive when it comes to querying for metadata hence default_schema should probably be RA and not ra

                • 5. Re: Seam Generate Entities
                  maxandersen

                  mkay....really weird then. I don't see any freezes here....how big is the schema ?

                  • 6. Re: Seam Generate Entities
                    maxandersen

                    :) the world is a better place again.

                    • 7. Re: Seam Generate Entities
                      rogerwbmd

                      I am newbie to jboss and I was struggle on the same issue yesterday. Somehow I found in the forum that to add hibernate.default_schema=<schema name> line in the hibernate-console.properties will fix the problem. I tried and it worked.

                      Now, I have another question. I try to use "New -> Seam Entity." The java code is generated with default attributes (id, version, and name) are created and the table is also created in DB beautifully. However, when I like to modify or add attributes (like change name to first name,) I stuck. I don't know how to make the code change to update the table in DB. Or, I just have manully alter the table accordingly?

                      Thanks
                      Roger

                      • 8. Re: Seam Generate Entities
                        rogerwbmd

                        Do you mean this line: ?

                        Do you know when the DB update happens? Right after I save my change in the entity class, e.g. Person.java?

                        Thanks
                        Roger

                        • 9. Re: Seam Generate Entities
                          rogerwbmd

                          It works perfectly. Thanks!!!