8 Jan 2010

Using JPA in JavaFX Application

Using JPA for creating, updating and deleting records in database is very useful and efficient way.
However, if you try to create 'Entity Class from Database' using NetBeans 6.8, no class will be added in your project. Because, if your project is JavaFX Script Application, you cannot create Persistence Unit in there.

To resolve this problem, I tried to create Java Application.

In this Java Application, I created Entities from Database and JPA Controllers Classes from Entity Classes.
You can find META-INF folder with persistence.xml file.

After I configured and tested the BoardFXJPA, I copied all packages (folders) in Source Package to JavaFX Script Application.

However, you can face errors at most of the classes you've copied. To resolve these errors, you need to set up library for persistence unit.

After you add all essential libraries, you can find all the errors are resolved.
And then try to use JPA controllers and entity classes in your JavaFX application.


Post a Comment