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 7968863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:08:41+00:00 2026-06-04T07:08:41+00:00

I did alot of work with XML schema and JAXB to generate java beans.

  • 0

I did alot of work with XML schema and JAXB to generate java beans. I never touched the generated beans, only extended them in other beans, because otherwise I might loose code if beans are regenerated. I actually generate my beans newly automatically before any build is allowed to happen. This gurantees me to only always have one truth.

Is the same idea valid for JPA bean generation, or is JPA bean generating meant to be a one time thing?

Should you touch the generated JPA beans or are they untouchable? I can’t find any style or best practise recommendation…

  • 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-06-04T07:08:43+00:00Added an answer on June 4, 2026 at 7:08 am

    It’s actually a best practice to put code (other than getters and setters) in JPA entities. Not doing so results in an anemic domain model.

    Generating JPA entities from a schema can be useful to start you up, but once this is done, you should fine-tune the code and the design of these entities and add business logic in them. It’s not hard at all to write entities from scratch, without any generation phase.

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

Sidebar

Related Questions

I was trying to understand how mutexes work. Did a lot of Googling but
We are using XML to define a schema for controlling the contents which can
A few years ago I did a lot of work with CGI.pm. I'm evaluating
I did a lot of Googling and was not able to find a PERFECT
Before asking this i did A LOT of searching on the net. I just
After searching a lot i did not get any answers and finally i had
There were a lot of promises and hopes, but did MS actually get around
Did you used Dynamic websites before? you see its a good way for making
Did some searches here & on the 'net and haven't found a good answer
Did you ever have the following situation: you need to store information, but a

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.