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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:04:33+00:00 2026-05-27T22:04:33+00:00

I am using Hibernate, Maven, and Eclipse (STS build) to build a project. I’m

  • 0

I am using Hibernate, Maven, and Eclipse (STS build) to build a project. I’m using hbm.xml files to specify my schema. I want to use Hibernate’s hbm2java to generate my model classes. I have it working well and generating the kind of code I want.

It runs perfectly from the command line, generating the model code and then building and testing as expected.

However, Eclipse seems unable to handle it. It will periodically “lose its mind” and be unable to resolve very simple imports and classes referenced in my DAO classes, which are hand-coded. The things it can’t find are classes like HibernateUtil. Ironically, it appears to not have any trouble finding the model classes.

The unresolved classes are in target/classes/blah-blah folder at the end of the run. So they’re apparently getting copied to the right place.

In a “continuous integration” environment, is it best to generate the sources once, commit them to my version control, and then disable code gen? Or is it possible to have the code generated each time, thus ensuring I pick up any database changes without human intervention?

  • 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-27T22:04:33+00:00Added an answer on May 27, 2026 at 10:04 pm

    IMHO, entities should be the core of your application, and should be designed, implemented and documented with care. They’re supposed to be objects, with methods encapsulating behavior. Having them autogenerated is an absurdity, IMO.

    Generating them at the very beginning might be an option to get you started, but once they’ve been generated, hand-craft them and don’t generate them again. Add necessary properties and methods as the schema changes, and refactor existing code.

    BTW, I really prefer using annotations for the mapping, because it’s less verbose, less error-prone, and all the information is in a single place.

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

Sidebar

Related Questions

I'm trying to build a new web app using Eclipse, I want to use
I have created a Spring 3 + Hibernate project using Maven in Eclipse. How
I'm using m2e (1.0.100), Eclipse (Indigo SR1) and hibernate-jpamodelgen (1.1.1.Final). I want to have
I am creating a project using maven with spring and hibernate. I added a
I´m busy converting an existing project from an Ant build to one using Maven.
Most Hibernate tutorials use Maven for handling the build, but I'm looking for a
I want to use Maven 2 for buliding Web App using Spring 3.05 and
I'm using Hibernate 3.3.1GA and Spring 3.0.2 (and Maven from eclipse). I added c3p0-0.9.1
I'm trying to migrate an existing eclipse web project (wtp) to maven, using m2e.
I have a simple spring3,hibernate 3 project.When am trying to build the project using

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.