• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting the values in POJO Class after fetching the values from db via hibernate  RSS feed

 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting the values in POJO Class after fetching the values from db via hibernate



Fetch the owners from the db and display in the jsp.

My POJO class



My question may seem a little bizzare, I know in the jsp the get*() methods are being called by the EL, but where are the set*() methods for the Owner class called? How is the value being set in the POJO?

Are the values after being fetched from the db being set in the POJO internally by hibernate?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The persistence provider (for example: Hibernate) is responsible for setting those values in the object that gets returned. It depends on the persistence provider, whether it calls the setters or uses other methods (like direct field access via reflection) to set those values in the object.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!