7 Replies Latest reply on Sep 26, 2016 10:57 AM by George Gastaldi

    options for jpa-generate-entities-from-tables

    Gerry Matte Apprentice

      How do I see the current list of options for a specific version of jpa-generate-entities-from-tables ?

      I am running forge 2.20.1.Final from a windows command line using

      jpa-generate-entities-from-tables --databaseTables * --targetPackage ca.gerrymatte.health.model --hibernateDialect org.hibernate.dialect.MySQL5InnoDBDialect --driverClass com.mysql.jdbc.Driver --driverLocation D:/s/jclasses/drivers/mysql.jar --userName root --userPassword secret --jdbcUrl jdbc:mysql://127.0.0.1/health?autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=false ;

       

      And the error code I get is ***ERROR*** At least one database table must be specified

       

      I also tried forge 3.3.1.Final and encountered even more errors:

      1. When it slipped into interactive mode, all of my input was discarded so I had to retype everything

      2. I was prompted to choose between Angular.js and Faces (for what ?)  I chose Faces

      3. Same error: ***ERROR*** At least one database table must be specified

       

       

       

       

        • 1. Re: options for jpa-generate-entities-from-tables
          George Gastaldi Master

          Hi Gerry,

           

          1) In Forge 3, the option names were changed to a unix-like case: (eg. --targetPackage is now --target-package), maybe that's why it is prompting you again?

          2) No idea on that, that should happen only if you run scaffold-generate or scaffold-setup afaik.

          3) This could be related to #1?

           

          I'll try to reproduce it nevertheless. Let me know how it goes. Forge 2.x has been superceeded by Forge 3.x, so I'd suggest you to try it with 3.3.1.Final

           

          Best Regards,

           

          George Gastaldi

          • 2. Re: options for jpa-generate-entities-from-tables
            Gerry Matte Apprentice

            Thanks for the quick response George.

            I'd like to use the current release - what are the option names now ?

            Gerry

            • 3. Re: options for jpa-generate-entities-from-tables
              George Gastaldi Master

              If you type jpa-generate-entities-from-tables and press <TAB> you'll see the available options. I don't recall from the top of my head but they are the same except following the new nomenclature (eg. --database-tables instead of --databaseTables, etc)

              • 4. Re: options for jpa-generate-entities-from-tables
                Gerry Matte Apprentice

                Using Forge 3,3,1,Final not all required options appear using the <tab> key :

                --connection-profile  --driver-location --jdbc-url       --target-package  --user-password
                --driver-class    --hibernate-dialect   --save-user-password  --user-name       --verify-connection

                The most important option missing is

                --database-tables *

                 

                The correct results were obtained using:

                jpa-generate-entities-from-tables --database-tables * --target-package ca.gerrymatte.health.model --hibernate-dialect org.hibernate.dialect.MySQL5InnoDBDialect --driver-class com.mysql.jdbc.Driver --driver-location D:/s/jclasses/drivers/mysql.jar --user-name root --user-password secret --jdbc-url jdbc:mysql://127.0.0.1/health?autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=false ;

                 

                Sun Sep 25 18:42:21 PDT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

                Sun Sep 25 18:42:23 PDT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

                ***SUCCESS*** 6 entities were generated in ca.gerrymatte.health.model

                • 5. Re: options for jpa-generate-entities-from-tables
                  George Gastaldi Master

                  Hi Gerry,

                   

                  --database-tables will only be shown after the JDBC connection info is set (--jdbc-url or --connection-profile). If you invoke it in a GUI environment, you'll see that the Database tables will be shown after you press Next (which is disabled until you set the JDBC URL or choose a Connection profile)

                   

                  Best Regards

                  • 6. Re: options for jpa-generate-entities-from-tables
                    Gerry Matte Apprentice

                    The statement which succeeded for me in a command line window begins with jpa-generate-entities-from-tables --database-tables *

                     

                    I don't understand your comment ..... if I did not specify database-tables interactive mode kicks in and the option database-tables is not prompted for.

                    So, it's not possible to succeed if interactive mode is triggered.

                     

                    I suspect this is a bug.

                    Gerry

                    • 7. Re: options for jpa-generate-entities-from-tables
                      George Gastaldi Master

                      What I meant is that --database-tables needs to be provided, but it will only be available when you type <TAB> after you specify the connection parameters