How to skip the schema generation of a superclass table? Java/JPA/Hibernate/Annotations/Maven/hbm2ddl

Our application has a need to share an existing database table with another locally running application, and, so, I wish to refer to this table but skip generating the DDL for it. I also hoped to define the table in the application's schema as an alias or MySQL merge table, but I can add that to a manual script that will run before the generated schema script. How can I specify that the create and alter table DDL for the shared_schema table are omitted from the myapp-schema-ddl.sql output? From commons/src/main/java/com/company/shared/SharedSuperEntity.java: @Entity @Table(name="shared_entity", catalog = "shared_schema") @Inheritance(strategy = InheritanceType.JOINED) public class SharedSuperEntity { // fields, etc... } From myapp/src/main/java/com/company/shared/SharedSuperEntity.java: @Entity @Table(name="local_entity", catalog = "local_schema") public class LocalEntity extends SharedSuperEntity { // fields, etc... } From myapp/src/main/resources/META_INF/persistence.xml: org.hibernate.ejb.HibernatePersistence java:/LocalDS com.company.shared.SharedSuperEntity com.company.myapp.LocalEntity true NONE AUTO From within myapp/pom.xml: org.codehaus.mojo hibernate3-maven-plugin 2.2 hbm2ddl jpaconfiguration MyAppPU myapp-schema-ddl.sql false true false true true org.hibernate hibernate-core 3.6.0.Final compile org.hibernate hibernate-entitymanager 3.6.0.Final compile org.hibernate.javax.persistence hibernate-jpa-2.0-api 1.0.0.Final compile mysql mysql-connector-java 5.1.16 jar compile

以上就是How to skip the schema generation of a superclass table? Java/JPA/Hibernate/Annotations/Maven/hbm2ddl的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏