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 have been trying there last days to extend the default editor (java, xml,
I have three columns in my table - company_name, first_name, last_name . In the
I got stuck by this error message because for three days I didn't find
I have the following three queries which get the average price for a product
I have three tables as a SQLITE3 Dump. products,tax,inventory From these tables preparing a
alright, so lets say i have three tables, as follows : employees( ID ,
Is there another way to get the last child of a div element other
Is there some way to get a value from the last inserted row? I
Is there a way that I can get the last value (based on the
Is there a way to include a javascript-loaded advertisement last on the page, but

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.