2014-09-20 67 views
0

我有以下的persistence.xml:爲什麼在hibernate4-maven-plugin(Hibernate 4.3.6)中不能使用hbm2ddl.import_files?

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> 
    <persistence-unit name="blah" transaction-type="RESOURCE_LOCAL"> 
    <properties> 
     <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/> 
     <property name="hibernate.hbm2ddl.auto" value="create"/> 
     <property name="hibernate.hbm2ddl.import_files" value="myfile.sql"/> 
    </properties> 
    </persistence-unit> 
</persistence> 

hibernate.hbm2ddl.import_files財產不能正常工作。似乎並不重要,我把myfile.sql放在哪裏,或者用斜槓或甚至通配符,類路徑等(抓住吸管) - 它從來沒有發現它,並且日誌輸出並不表示它正在尋找它。默認使用import.sql代替(和工作)。

注意:看過類似的問題(例如thisthis),但沒有一個解決方案適用於我。

回答

1

我現在認爲這個問題是由於使用了hibernate4-maven-plugin - 它似乎不支持所有的Hibernate屬性。

相關問題