We are in the beginning coding phase for project that we are using JPA with. We used the tools in Netbeans to generate our JPA entities based on our schema. It worked pretty well, but as always we have had to customize the entities a good bit since then.
We made a decent size change to our schema (added a table, and swapped around relationships between others) and as such needed to update our entities. We could not regenerate them, as we would have to go and reapply all the customizations we had, so we did it all by hand. Not a big deal, just more time consuming then I expected.
The customizations were Named Queries we added, Cascade Types, our own to String methods, equals and hash code methods. I thought about creating classes that extended the entities to add in the toString, equals, and hascode methods, that way if we regenerated them, they would not be lost. But I was not sure about the Cascade Types and named queries.
Is there a better way, or is this just wishful thinking?