我想生成一个hibernate.reveng.xml,但是hibernate.cfg.xml中的“hibernate.connection.URL” > 是一个变量。
jdbc:jtds:sqlserver://${database.server.name}:1433/XXX_DB
所以我的问题是如何让hibernate-tool知道变量在哪里定义?
最佳答案
您可以在 ant 任务中指定 .properties 文件(将包含此内容)的路径:
hibernate.connection.url=jdbc:mysql://127.0.0.1:1433/XXX_DB
hibernate.connection.username=xxx
hibernate.connection.password=yyy
然后,在 Ant 任务中:
<hibernatetool ...>
<jdbcconfiguration configurationfile="pathTo/your.cfg.cml"
propertyfile="pathTo/your.file.properties"/>
希望对你有帮助 迭戈。
关于java - 无法生成 hibernate.reveng.xml,因为 hibernate.connection.url 是动态的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14155500/