Skip to main content

Home/ SoftwareEngineering/ Group items tagged getReference

Rss Feed Group items tagged

kuni katsuya

jpa - When to use EntityManager.find() vs EntityManager.getReference() - Stack Overflow - 0 views

  • When to use EntityManager.find() vs EntityManager.getReference()
  • use getReference method when i do not need to access database state
  • getReference returns a proxy object which uses a powerful feature called
  • ...1 more annotation...
  • automatic dirty checking
  •  
    "When to use EntityManager.find() vs EntityManager.getReference()"
kuni katsuya

java - what is difference between EntityManager.find() and EntityManger.getReference()?... - 0 views

  • what is difference between EntityManager.find() and EntityManger.getReference()?
  • find()
  • return an initialized instance of your object
  • ...6 more annotations...
  • If it is not already loaded in the EntityManager, it is retrieved from the database
  • getReference()
  • is allowed to return a proxy instread of an initialized instance, if the entity has not been loaded in the EntityManager before
  • In this proxy,
  • only the primary key attribute is initialized
  • Proxies can be created without hitting the database
1 - 2 of 2
Showing 20 items per page