4 Replies Latest reply on Oct 23, 2008 5:11 PM by Dan Allen

    No db reverse engineering in Seam 2.1.0 beta1?

    Thai Dang Vu Apprentice
      I followed the steps in the Seam in Action book (seam setup, seam create-project, seam generate and seam explode) but I didn't see any db reverse engineering. All builds successful.

      More information: I don't use the H2 db, but the Oracle 10 XE. This is the DLL to create tables for the Open18 project:

      create table FACILITY (id number(12) primary key, name varchar2(32) not null, type varchar2(24) not null)

      create table COURSE (ID number(12) primary key, NAME varchar2(32) not null, FACILITY_ID number(12),
        constraint COURSE_FACILITY_FK1 foreign key (FACILITY_ID) references FACILITY (ID))

      create table HOLE (ID number(12) primary key, NUMB3R number(3) not null, COURSE_ID number(12),
        constraint HOLE_COURSE_FK1 foreign key (COURSE_ID) references COURSE (ID))

      create table TEE_SET (ID number(12) primary key, name varchar2(32) not null, color varchar2(16), COURSE_ID number(12),
        constraint TEESET_COURSE_FK1 foreign key (COURSE_ID) references COURSE (ID))

      create table TEE (DISTANCE number(3) not null, HOLE_ID number(12) not null, TEE_SET_ID number(12) not null,
        constraint TEE_PK primary key (HOLE_ID, TEE_SET_ID) enable,
        constraint TEE_HOLE_FK1 foreign key (HOLE_ID) references HOLE (ID),
        constraint TEE_TEE_SET_FK1 foreign key (TEE_SET_ID) references TEE_SET (ID))

      Anybody in this situation before?
        • 1. Re: No db reverse engineering in Seam 2.1.0 beta1?
          Jay Balunas Novice

          what kind of output do you see when you run generate?  Were there any errors or messages at all?


          What did you put into your seam setup for db info?  Did you say you were working with tables that already exist?


          Regards,
          Jay

          • 2. Re: No db reverse engineering in Seam 2.1.0 beta1?
            Thai Dang Vu Apprentice
            Thank you very much for a quick help (that reminds me of Karld Moore (I might misspell his name) in Spring forum).

            This is the 'seam generate' output:

            C:\java\seam-2.1.0.BETA1>seam generate
            Buildfile: C:\java\seam-2.1.0.BETA1\seam-gen\build.xml

            init:

            init-properties:
                 [echo] C://java//jboss-4.2.3.GA

            validate-workspace:

            validate-project:

            init-generate:

            generate-model:
                 [echo] Reverse engineering database using JDBC driver C:\\java\\sqldevelope
            r\\jdbc\\lib\\ojdbc6.jar
                 [echo] project=C://java//IdeaProjects//s-ex/open18
                 [echo] model=org.open18.bean.entity
            [hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engi
            neering)
            [hibernate] 1. task: hbm2java (Generates a set of .java files)
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.cfg.Environment <clinit>
            [hibernate] INFO: Hibernate 3.2.4.sp1
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.cfg.Environment <clinit>
            [hibernate] INFO: hibernate.properties not found
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.cfg.Environment buildBytecodePr
            ovider
            [hibernate] INFO: Bytecode provider name : cglib
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.cfg.Environment <clinit>
            [hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.cfg.reveng.OverrideRepository a
            ddFile
            [hibernate] INFO: Override file: C:\java\IdeaProjects\s-ex\open18\resources\seam
            -gen.reveng.xml
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.connection.DriverManagerConnect
            ionProvider configure
            [hibernate] INFO: Using Hibernate built-in connection pool (not for production u
            se!)
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.connection.DriverManagerConnect
            ionProvider configure
            [hibernate] INFO: Hibernate connection pool size: 20
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.connection.DriverManagerConnect
            ionProvider configure
            [hibernate] INFO: autocommit mode: false
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.connection.DriverManagerConnect
            ionProvider configure
            [hibernate] INFO: using driver: oracle.jdbc.OracleDriver at URL: jdbc:oracle:thi
            n:@172.18.132.53:1521:xe
            [hibernate] Sep 9, 2008 6:30:45 PM org.hibernate.connection.DriverManagerConnect
            ionProvider configure
            [hibernate] INFO: connection properties: {user=ly, password=****}
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: RDBMS: Oracle, version: Oracle Database 10g Express Edition Re
            lease 10.2.0.1.0 - Production
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: JDBC driver: Oracle JDBC driver, version: 11.1.0.6.0-Productio
            n+
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.dialect.Dialect <init>
            [hibernate] INFO: Using dialect: org.hibernate.dialect.Oracle9Dialect
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.transaction.TransactionFactoryF
            actory buildTransactionFactory
            [hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.transaction.TransactionManagerL
            ookupFactory getTransactionManagerLookup
            [hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, us
            e of read-write or transactional second-level cache is not recommended)
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Automatic flush during beforeCompletion(): disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Automatic session close at end of transaction: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: JDBC batch size: 15
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: JDBC batch updates for versioned data: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Scrollable result sets: enabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: JDBC3 getGeneratedKeys(): disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Connection release mode: auto
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Default schema: ly
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Default batch fetch size: 1
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Generate SQL with comments: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Order SQL updates by primary key: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Order SQL inserts for batching: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory createQuery
            TranslatorFactory
            [hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFact
            ory
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.hql.ast.ASTQueryTranslatorFacto
            ry <init>
            [hibernate] INFO: Using ASTQueryTranslatorFactory
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Query language substitutions: {}
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: JPA-QL strict compliance: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Second-level cache: enabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Query cache: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory createCache
            Provider
            [hibernate] INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Optimize cache for minimal puts: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Structured second-level cache entries: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Statistics: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Default entity-mode: pojo
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.SettingsFactory buildSettin
            gs
            [hibernate] INFO: Named query checking : enabled
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.connection.DriverManagerConnect
            ionProvider close
            [hibernate] INFO: cleaning up connection pool: jdbc:oracle:thin:@172.18.132.53:1
            521:xe
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.tool.Version <clinit>
            [hibernate] INFO: Hibernate Tools 3.2.2.GA
            [javaformatter] Java formatting of 0 files completed. Skipped 0 file(s).

            generate-ui:
                 [echo] Building project 'open18' to generate views and controllers

            init:

            compile:

            copyclasses:

            jar:
                 [copy] Copying 1 file to C:\java\IdeaProjects\s-ex\open18\exploded-archives
            \open18.jar\META-INF
                 [copy] Copying 1 file to C:\java\IdeaProjects\s-ex\open18\exploded-archives
            \open18.jar
            [hibernate] Executing Hibernate Tool with a JPA Configuration
            [hibernate] 1. task: generic exportertemplate: view/list.xhtml.ftl
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.cfg.annotations.Version <clinit
            >
            [hibernate] INFO: Hibernate Annotations 3.3.0.GA
            [hibernate] Sep 9, 2008 6:30:46 PM org.hibernate.ejb.Version <clinit>
            [hibernate] INFO: Hibernate EntityManager 3.3.1.GA
            [hibernate] 2. task: generic exportertemplate: view/view.xhtml.ftl
            [hibernate] 3. task: generic exportertemplate: view/view.page.xml.ftl
            [hibernate] 4. task: generic exportertemplate: view/edit.xhtml.ftl
            [hibernate] 5. task: generic exportertemplate: view/edit.page.xml.ftl
            [hibernate] 6. task: generic exportertemplate: src/EntityList.java.ftl
            [hibernate] 7. task: generic exportertemplate: view/list.page.xml.ftl
            [hibernate] 8. task: generic exportertemplate: src/EntityHome.java.ftl
            [hibernate] 9. task: generic exportertemplate: view/layout/menu.xhtml.ftl
            [javaformatter] Java formatting of 1 files completed. Skipped 0 file(s).
                 [echo] Type 'seam restart' and go to http://localhost:8080/open18

            generate:

            BUILD SUCCESSFUL
            Total time: 2 seconds

            And this is the build.properties:

            #Generated by seam setup
            #Tue Sep 09 18:28:06 EDT 2008
            hibernate.connection.password=abc123
            workspace.home=C\://java//IdeaProjects//s-ex
            model.package=org.open18.bean.entity
            driver.jar=C\:\\\\java\\\\sqldeveloper\\\\jdbc\\\\lib\\\\ojdbc6.jar
            action.package=org.open18.bean.session
            test.package=org.open18.test
            database.type=oracle
            richfaces.skin=blueSky
            hibernate.default_catalog.null=
            hibernate.default_schema=ly
            database.drop=n
            project.name=open18
            hibernate.connection.username=ly
            hibernate.connection.driver_class=oracle.jdbc.OracleDriver
            hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
            project.type=ear
            icefaces.home=
            database.exists=y
            jboss.home=C\://java//jboss-4.2.3.GA
            hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
            hibernate.connection.url=jdbc\:oracle\:thin\:@172.18.132.53\:1521\:xe
            icefaces=n

            If I left the default schema blank (the hibernate.default_schema=ly turned into hibernate.default_schema.null=), I saw some errors (perhaps because hibernate tools reverse engineered all the views, public synonyms I have the priviledge to see).
            • 3. Re: No db reverse engineering in Seam 2.1.0 beta1?
              Meena Swaminathan Newbie

              Hi,


              I am also facing the same problem. Were you able to resolve this?
              I tried ojdbc6.jar using jb0ss-seam-2.0.0, Jboss-seam-2.0.2 and Jboss-seam-2.0.3


              In all of these the builds were successful but i do not see the entities generated.

              • 4. Re: No db reverse engineering in Seam 2.1.0 beta1?
                Dan Allen Master

                Fortunately, I have experience with this problem from doing a seam-gen project with Oracle at my last gig. You have to type the schema name in uppercase in the seam-gen settings or else Hibernate will not be able to locate it. What makes this problem extremely annoying is that neither Oracle nor Hibernate will complain if the schema cannot be found. It just silently generates no entities.


                hibernate.default_schema=LY
                



                Let me know if that works for you. If it doesn't, the problem still remains the same. Hibernate is not able to see the tables because the settings aren't right. This is not a seam-gen problem (specifically).