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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:03:44+00:00 2026-05-17T00:03:44+00:00

For the last three days i am learning JPA by various examples, to change

  • 0

For the last three days i am learning JPA by various examples, to change my JDBC code to JPA. Every JPA example and tutorial have main method to run it. Of course,
in main method only they defining EntityManager & EntityManagerFactory.

I dont have main method in my web application’s server side code. Is that a problem in point of using JPA. Or Creation of EntityManager & EntityManagerFactory in other classes
is allowed.
and it would be appreciative, if anyone explain me about using hibernate in JPA.

  • 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-17T00:03:45+00:00Added an answer on May 17, 2026 at 12:03 am

    Every JPA example and tutorial have main method to run it.

    That’s only useful for code that is intended to run outside a container, which is often the case of tutorials.

    I don’t have main method in my web application’s server side code. Is that a problem in point of using JPA.

    No. Absolutely not.

    Or Creation of EntityManager & EntityManagerFactory in other classes is allowed.

    There is no particular restriction on EntityManagerFactory and EntityManager (beyond the fact that the EMF should be created once for the lifetime of the application and that the common pattern for the EM in a web application is entityManager-per-request i.e. to open an EntityManager at the start of a request and to flush and close it at the end).

    And it would be appreciative, if anyone explain me about using Hibernate in JPA.

    Hibernate can be used as JPA provider (more precisely, the implementation is provided by the satellite project Hibernate EntityManager). But your question is too vague. If you have a specific problem, open another question and describe it.

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

Sidebar

Related Questions

I am learning OpenGL these days, and I tried to compile the example code
During last three days I have been trying to solve Project Euler 15 in
I have been digging since last three days to find out the appropriate way
For the last three days I have been trying to develop a web based
I have a problem I have been trying to solve for last three days.
I spent the last three days working on the collection _ select form helper
Hi everyone I am in my last three days before I present my final
I have three text fields: first name, last name, and age, also a photo.
I spent the last three days trying to create a small app using SDL
I've been doing the following for the last three days without any success. Suppose

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.