3 Replies Latest reply on Dec 13, 2016 8:01 AM by gastaldi

    jpa-generate-entities-from-tables woes

    mikefinn

      Using 3.4.0 Final, CLI, trying to generate from tables in an Oracle DB. For argument "database-tables", any argument besides * gives the error "***ERROR*** At least one database table must be specified". Even if I provide a single table name, same error.

       

      When I do use *, it appears that the generator is trying to reverse engineer every single table on the entire catalog (all schemas). I only know that because it does fail on a table that is an a schema that is not owned by the username I am using. I have tried prefixing * (and single table name) with the schema name, but it does not work.

       

      --database-tables * <-- Does every table in the database (all schemas).

      --database-tables FOO_TABLE <-- Errors with "***ERROR*** At least one database table must be specified"

      --database-tables FOO_SCHEMA.* and --database-tables FOO_SCHEMA.FOO_TABLE <-- Errors with "***ERROR*** At least one database table must be specified"

       

      Has anyone successfully used this command with an Oracle database?

       

      Any help appreciated.

        • 1. Re: jpa-generate-entities-from-tables woes
          gastaldi

          Hi Mike,

           

          Have you specified the --database-schema and --database-catalog parameters before specifying the --database-tables parameter?

          What happens when you press <TAB> after --database-tables?

           

          Best Regards,

           

          George Gastaldi

          • 2. Re: jpa-generate-entities-from-tables woes
            mikefinn

            I was not aware of the database-schema and database-catalog options. I did try them (setting to the schema name where the tables are), but roughly same result. Tab at the end gives me nothing. When I specify * or an actual table name, all I get is "***ERROR*** At least one database table must be specified".

             

            Example:

            [persistence.xml]$ jpa-generate-entities-from-tables --driver-class oracle.jdbc.OracleDriver --driver-location path/to/oracle-ojdbc6-11.2.0.4.0.jar --hibernate-dialect org.hibernate.dialect.Oracle10gDialect --jdbc-url <url> --user-name <user> --user-password <pass> --save-user-password --verify-connection --database-schema <schema-name> --database-catalog <schema-name> --target-package com.FooOne --database-tables *

            ***ERROR*** At least one database table must be specified

             

            Thanks in advance,

            Mike

            • 3. Re: jpa-generate-entities-from-tables woes
              gastaldi

              Can you provide a sample schema and create a ticket in https://issues.jboss.org/browse/FORGE ?

              We'll have a look at this asap