• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the use of ejbFindByPimarykey()?  RSS feed

 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have confused with concept of ejbFindByPrimarykey() method.Could you please tell me the purpose of this method?

regards
Sridhar
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is used to find an entity by its primary key and is called by the container. It is how the container itself loads an entity.
 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I tried to access EMP table which has EMPNO as primary key.

Can we access EMP table all columns with this primary key by using ejbFindByPrimaryKey() method?

If the return value for ejbFindByPrimaryKey() is primary key class , then How can we access all columns with this method?

regards
Sridhar
 
Suhas Nair
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
findByPrimaryKey(key) is used to find and return an entity with the given primary key. Instead of primary key class, it returns the entity itself.

You can access all the columns defined for this entity, call a remove (delete the entity ) etc using this return value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!