开发者

Jdeveloper - generate tables from JPA entities

开发者 https://www.devze.com 2023-02-06 03:54 出处:网络
I\'ve开发者_Go百科 got some JPA entities and I\'m trying to generate the DB schema from them in Jdeveloper.

I've开发者_Go百科 got some JPA entities and I'm trying to generate the DB schema from them in Jdeveloper.

All tables are only generated with the Id (Primary Key) and not any additional fields/constraints I've defined in the Entity classes.

Any ideas what I should be looking at?

JDev 11.1.1.3 connecting to Oracle 10g XE


What JPA implementation are you using?

In Hibernate, this is controlled by the "hibernate.hbm2ddl.auto" configuration property; to wit: "hibernate.hbm2ddl.auto=update" will update your schema to match your annotations. The documentation is a little cryptic, but you can find it here: http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/entityconfig.html.

In TopLink, this is controlled by the "toplink.ddl-generation" configuration property. For EclipseLink, I think it's "eclipselink.ddl-generation.output-mode"--but I haven't used that in a very long time, so you'll want to verify.

In general, documentation refers to this behavior as "DDL Generation"; if you're using a JPA implementation other than Hibernate or TopLink, you can google that phrase plus the name of your implementation to get yourself close.

0

精彩评论

暂无评论...
验证码 换一张
取 消