Question

I am using OpenJPA and HSQLDB for my current project.

But I am unable to generate JPA entities from the HSQLDB because eclipse plugin is not giving me an option to select the schema.

Does anybody have idea about this? Or is there any other way to generate entities in eclipse?

Was it helpful?

Solution

I am assuming that you are using the "standard" JPA tooling (JPT), since you are not specifying otherwise.

First, you need to define a connection (in the Data Source Exlporer). You should be able to drill down and see the actual tables you need to work with:

alt text

You select the schema on the "JPA Facet" page when you create the JPA project or activate the JPA Facet: There is a checkbox called "Override default schema from connection", and a combo-box where you select the "Schema":

Screen shot of the JPA Facet property page

You can even select the schema when you ask to generate entities (right click on the project, JPA Tools > Generate Entities from Tables...), and then you get this dialog: Dialog where you can select a different schema

Happy Mapping!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top