JoseK
JoseK

Reputation: 31371

Jdeveloper - generate tables from JPA entities

I've 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

Upvotes: 0

Views: 2419

Answers (1)

Jerry Andrews
Jerry Andrews

Reputation: 847

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.

Upvotes: 1

Related Questions