When I use IntelliJ to generate a persistence mapping from exisitng database schema it puts a catalog
value as part of @Table
annotation. Unfortunately names of database instances have names of dev/test/prod environemnts in them and while I can overwrite the connection string with a map passed to EntityManagerFactory
I still get Invalid object name 'BAR_DEV.dbo.FOO'
when executing a query against BAR_TEST
instance.
Can I dynamically overwrite the catalog
value at runtime without doing global search and replace to remove it manually after entity generation?
@Entity
@Table(name = "FOO", schema = "dbo", catalog = "BAR_DEV")
public class Foo{ /* ... */ }