• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Why entity Manager is not initializing  RSS feed

 
Ranch Hand
Posts: 174
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm implemeting a small application with using JBoss Application server. To keep connection between server and the Db I use Entity manager object.
In my bean definition class i use following code for that



Then in save ,delete ,retrieve methods just use entityManager and call Entity Manager class methods.But I don't have any idea why we don't initialize this entityManager
like

How we achieve our behaviors without initializing?
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because spring will automatically create a bean called entityManager when it finds the annotation @PersistenceContext in the context when the application started.
 
chamini prashakthi
Ranch Hand
Posts: 174
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here I use JPA object in the project.So It is based on Hibernate.Not Spring as I think. So is it Correct?
Because I don't know where I use Spring in this project !
 
John Joe
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you are right. Generally annotation is a kind of bean creation or initialization be it a JPA, Spring, etc beans in Java.
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!