JPA Support

We are at the beginning of the coding phase for the project with which we use JPA. We used tools at Netbeans to create our JPA objects based on our schema. This worked very well, but as always, we had to tweak the entities since then.

We made a decent change in the size of our scheme (we added a table and exchanged relationships between others), and as such it was necessary to update our entities. We could not restore them, since we would have to go and re-apply all the settings that we had, so we did it all manually. It doesn't matter, just more time than I expected.

Named Queries, Cascade Types, our own String methods, equals and hash code methods were added to the settings. I was thinking of creating classes that extended entities to add to toString, equals, and hascode methods, so if we restore them, they will not be lost. But I was not sure about the Cascade types and named the queries.

Is there a better way, or is it just wishful thinking?

+3
source share
1 answer

, . . , @MappedSuperclass . , , , , ... .

, .

. , .

- .

+1
source

Source: https://habr.com/ru/post/1747400/


All Articles