2

I have a WebService that was created by a developer that is no longer with us, that uses the following syntax @Table(name = "Tax", catalog = "dbProduction", schema = "")

the database has been renamed and the webservice no longer works, I manually renamed the @Table annotations to @Table(name = "Tax", catalog = "dbProduction2013", schema = "")

I would like to know if there is a simple way to make this a parameter that automatically finds the database name given a connection? Is there a way to make the whole process automatic? I am using NetBeans 7.2.1

4

1 回答 1

0

您可以轻松地在orm.xml中设置“目录” (根据http://www.datanucleus.org/products/accessplatform_3_2/jpa/metadata_xml.html#catalog),然后将它放在一个地方。显然,这意味着您不再将部署信息嵌入到单个类中,这在大多数组织中应该是推荐的做法。

于 2013-01-09T19:02:31.170 回答