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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:27:06+00:00 2026-06-12T09:27:06+00:00

I am in the process of troubleshooting a recent translation of EJB code to

  • 0

I am in the process of troubleshooting a recent translation of EJB code to native Hibernate code (painful process, since EJB spoiled me so much with its convenience).

One thing I find troublesome is that Hibernate keeps its entity declarations in a hbm.xml file and then the configurations in separate files. While this isn’t necessarily a big issue, the Netbeans wizard doesn’t really let the developer to just click a button, detect, all the entities on the fly, and update the configuration file.

With persistence.xml, however, I can do that easily by just adding the classes and forget about it. Another good thing is that persistence.xml stores pretty much everything needed for the ORM aside from the class-specific annotations (which I am keeping).

With that said, is there any way for me to have Hibernate to (1) stay off EE and (2) use persistence.xml to get the connection, mapping, etc?

Also, a related question – CriteriaQuery is apparently a Java EE thing. One thing I really like about using EJB is that there are strong compile-time contraints. For instance, I can put ClassName_.myAttribute directly as a parameter in a CriteriaQuery, whereas if I use the Hibernate native “Criteria” object, I have to use “my_attribute” instead, which is not subjected to compile time integrity checks (Note: ClassName_.myAttribute maps to “my_attribute” on the table).

So is there anyway to keep that compile-time integrity?

Thanks.

  • 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-12T09:27:07+00:00Added an answer on June 12, 2026 at 9:27 am

    Hibernate EntityManager can be used outside of a Java EE container. See http://docs.jboss.org/hibernate/core/4.0/hem/en-US/html_single/#architecture-javase.

    Moreover, even with the Hibernate native API, since you’re using annotations, you don’t need any hbm.xml file. Just a central Hibernate config file listing the entities and some Hibernate properties.

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

Sidebar

Related Questions

The process is not running as WOW64, its running as x64 in an x64
I process data with two maps per records, one is (&,=)-formatted (id=111&name=...), the other
While troubleshooting some cryptographic code, I saw a strange hierarchy of stacktraces. I've solved
Process during its lifetime has 1 main thread and from 1 to 50 other
Problem: Process a CSV file and test a condition on it. Current code simply
Process process = new Process(); ProcessStartInfo psi = new ProcessStartInfo(@C:/PsExec.exe); psi.UseShellExecute = false; psi.RedirectStandardOutput
Process A is calculating values for objects a1, a2, a3 etc. and is sending
Current Process: I have a tar.gz file. (Actually, I have about 2000 of them,
A process to quickly detect whether there is data in a given worksheet or
I process a lot of text/data that I exchange between Python, R, and sometimes

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.