Search code examples
javaentity-frameworkjpajsf-2netbeans

Generating Tables from existing Entities in Netbeans


I have a JSF project and I have a set of existing Entity classes. Is there anyway in Netbeans to generate Tables from my Entities without having to use the new entity wizard?

I found this functionality in Eclipse under the JPA Tools -> Generate Tables from Entitys as seen here: https://www.eclipse.org/webtools/dali/docs/3.2/user_guide/tasks007.htm

Thanks, the help us much appreciated.


Solution

  • Do you already have an Persistence Unit? If not, create one as follows. Right click on the project, select New -> Other. Click the Persistence Category, then the Persistence Unit file type. A persistence.xml file (PU) will be created. Include your entity classes in the PU and set the Table Generation Strategy to Create. When you run your project, the tables will be created.