Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Private fields in Field based persistence JPA

 
Sandhya Gutha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a question regarding "Field based persistence in JPA"
I was going through Field bases persisetnce concept in EJB 3 in action book. It says that "declare all data fields public or package protected" in field based persisetnce.
what happens to the private instance variables/fields. Are they persisted to the database, if Field based access is used..
If private variables are not persisted, then why do we need @Transient annotation.

Thank you,
Sandhya

 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA can persist private fields.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic