Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 910827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:06:10+00:00 2026-05-15T17:06:10+00:00

We are in the beginning coding phase for project that we are using JPA

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:06:10+00:00Added an answer on May 15, 2026 at 5:06 pm

    I believe this is just wishful thinking. Generating your entities and extending them just gives you a different set of problems. You generated entities will have to be annotated as @MappedSuperclass and won’t have table names – plus your extensions may have to repeat some of the annotations, plus you’ll have to tweak you named query customizations anyway sometimes….its all just a hassle.

    In general, the generation of entities from a database schema is a one-time thing, to be forever maintained by hand.

    Generation of a database schema from entities is however, possible to do over longer periods of time. However, even then, you’ll have to manage the issues around schema migration carefully.

    Bottom line — synchronising persistent entities and database schemas takes careful, manual work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 444k
  • Answers 445k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could go with the approach you are suggesting. This… May 15, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer The other answers recommending ClassLoader#getResourceAsStream() are expecting that the image… May 15, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer description is ann Objective-C property used for debugging and goes… May 15, 2026 at 6:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.