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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:42:34+00:00 2026-05-17T15:42:34+00:00

My project uses Spring, JPA, and Hibernate, so that all EntityManager’s are injected by

  • 0

My project uses Spring, JPA, and Hibernate, so that all EntityManager’s are injected by Spring.

I need to access persistent classes’ meta data such as column lengths and optionality. The only way I know to obtain this information is through Hibernate’s Configuration.getClassMapping(String className). In a pure Hibernate project without JPA and Spring, you can keep the Configuration after creating a SessionFactory(i.e. new Configuration().configure().buildSessionFactory()), but since Spring uses LocalEntityManagerFactoryBean to create a SessionFactory in the form of EntityManagerFactory, I’m not sure where to get the Configuration.

If it is not possible to retrieve the Configuration from Spring, is there any other way to access a persistent class’ meta data?

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-05-17T15:42:35+00:00Added an answer on May 17, 2026 at 3:42 pm

    It turns out that it is not possible. Spring creates an EntityManagerFactory in a standard way, using a PersistenceProvider implementation specified in the persistence.xml file. HibernatePersistence, which is Hibernate’s implementation of PersistenceProvider, does not keep the Configuration object after use. In order to expose the Configuration, you’ll need to implement PersistenceProvider on your own, which isn’t a big deal anyways.

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

Sidebar

Related Questions

A project I am working on uses Spring 2.5 & JPA with Hibernate as
My Java (JDK6) project uses Spring and JDBCTemplate for all its database access. We
I am working on a project that uses hibernate and spring. Hibernate is encapsulated
Scenario: A fairly mature project uses Struts2 and Spring and Hibernate. I say mature
I have been trying to create a Spring project that uses MyBatis for the
My project uses struts,hibernate and spring,oracle db ,WebLogic server. I have a transaction inserting
I've a project that uses Apache Camel (2.10-SNAPSHOT) and Spring (3.0.7.RELEASE) with Tomcat (7.0.26).
I have a Spring project that uses Maven and has several profiles to allow
The project I'm working on uses straight JDBC data access in all its boilerplate
My project uses tapestry 5.3.0,spring 3.0.6.RELEASE,hibernate 3.6.8.FINAL and maven.When I intruct jetty to start

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.