aspose file tools*
The moose likes Object Relational Mapping and the fly likes JPA - generate schema is possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA - generate schema is possible?" Watch "JPA - generate schema is possible?" New topic
Author

JPA - generate schema is possible?

andrew sydor
Greenhorn

Joined: Oct 20, 2009
Posts: 8

How I can generate a database schema using JPA?
example. Hibernate plugin hbm2ddl ?
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1676
    
    7

Yes. JPA is just a specification. You still need a persistence provider (implementation) like hibernate. If you use hibernate as your persistence provider you can still set the hibernate property (hibernate.hbm2ddl.auto) to have it generate your ddl.

[How To Ask Questions][Read before you PM me]
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

From what I recall ... (I usually do it the other way from DB -> Classes)


In Eclipse J2EE, start a new JPA project.

Import your annotated Java POJOs (Well I guess they're not plain anymore ;))

Click with right mouse button, and it should give you the option to generate DB object from Classes.

You may have to do some DB configuration, connection properties etc..


WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA - generate schema is possible?