Steve Chambers Steve Chambers - 1 year ago 85
MySQL Question

Why isn't hbm2ddl.import_files working in hibernate4-maven-plugin (Hibernate 4.3.6)?

I have the following persistence.xml:

<persistence xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="2.0">
<persistence-unit name="blah" transaction-type="RESOURCE_LOCAL">
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="" value="create"/>
<property name="hibernate.hbm2ddl.import_files" value="myfile.sql"/>

But the
property isn't working. Doesn't seem to matter where I put myfile.sql or prepend with a slash or even wildcards, classpath etc. (clutching at straws) - it never finds it and the log output doesn't indicate it is even looking for it. The default import.sql is used instead (and works).

Note: Have seen similar questions (e.g. this and this) but none of the resolutions worked for me.

Answer Source

I now think this problem is due to using the hibernate4-maven-plugin - it doesn't seem to support all the Hibernate properties.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download