Thanks, that's what I was looking for.
Unfortunately, I can't get it working.
Code:
export.database.schema:
[hibernatetool] Executing Hibernate Tool with a JPA Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
BUILD FAILED
~\-build.xml:71: org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
Total time: 1 second
I tried some possibilities. Setting the properties in the persistence.xml:
Code:
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/db" />
<property name="hibernate.connection.username" value="user" />
<property name="hibernate.connection.password" value="password" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
<property name="hibernate.show_sql" value="true" />
</properties>
.. the same as properties in the hibernate.properties. Nothing worked.
I don't know whether my persistence.xml is found or not: I deleted it, and I get still the same error. But if I set the following:
Code:
<jpaconfiguration persistenceunit="anything.that.doesnt.exist" />
I get the error
Code:
Persistence unit not found: 'anything.that.doesnt.exist'.
So it must be finding something. Is it just the package? It seems like it doesn't load my persistence.xml.