Java Reference
In-Depth Information
PostgreSqlDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property
name="hibernate.transaction.flush_before_completion"
value="true
"/>
<property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQL
Dialect"/>
</properties>
</persistence-unit>
</persistence>
Next, we will use the jpa-generate-entities-from-tables command in order
to generate your Entity class. You will need to provide the following Java Database
Connectivity ( JDBC) connection information:
• The JDBC URL
• The username and password
• The SQL dialect
• The JDBC driver class name
• The path in the filesystem where the JDBC driver is located
• The package where the entities will be generated
You can specify all the parameters in a one-line command or complete it interactively. The
final command would look like this (line breaks added for readability):
[persistence.xml]$ jpa-generate-entities-from-tables \
--jdbcUrl jdbc:postgresql://localhost:5432/forge \
--hibernateDialect org.hibernate.dialect.PostgreSQLDialect \
--userName jboss \
--userPassword jboss \
--driverLocation c:\\forge\\postgresql-9.3-1101.jdbc41.jar \
Search WWH ::




Custom Search