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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:48:40+00:00 2026-05-21T10:48:40+00:00

Hello all I’m trying to build up my first Hibernate project for a Web

  • 0

Hello all
I’m trying to build up my first Hibernate project for a Web app, but i’m having some issues
Trying to find out where to place the method:

AnnotationConfiguration config = 
            new AnnotationConfiguration();

config.addAnnotatedClass(Object.class);

config.configure();

i have some java beans decorated with annotations, shel i just insert it in the same class there the bean is?

Thank you

  • 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-21T10:48:41+00:00Added an answer on May 21, 2026 at 10:48 am

    Ideally, you’d call this only if you are developing a standalone application. In a Java EE environment, you’d just define a persistence.xml file (or hibernate.cfg.xml) in your deployment archive and the container (like JBoss AS) would make a @PersistenceContext (EntityManager) available to you.

    In a standalone application, you’d call this in your “Bootstrap” code. The one which sets up the environment.

    In “non-Java EE” web applications (seriously, who still uses that?), you’d have to resort to some “hacks”, like doing some initialization during context startup (so that you won’t need to run this for all requests, as it’s an expensive operation).

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

Sidebar

Related Questions

hello guys I am trying to extract all the anchor links from aol but
Hello all im trying to make this slide effect http://tinyurl.com/628z32d but im new to
Hello all i have an app it works fine on API 8 but i
Hello all having some trouble accessing elements from a returned JSON from Twitter. I'm
Hello to all I am here facing some situation of detecting url in asp.net
hello i am little new to all this but i want to know that:
hello all its my first application using Zend Framework i have followed tutorial it
Hello all I am using MS SQL Server 2008 R2 and needed some help
Hello all Im trying to do a series of when checks to concat two
Hello All I am trying to flatten a list in Ocaml. I am 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.