• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

different betwenn property based and field based persistance

 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the different betwenn property based and field based persistance ?
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Samanthi,

the actual differences may depend on the specifics of the O/R technology you are using.

When using JPA or Hbernate two differences which come to mind quickly are that it's all or nothing - if you choose field based persistence usually ALL fields are managed (by default), if you choose to use property based persistence all property accessors are persisted (by default). Depending on the interals (fields) and externals (properties) of your class it may be easier to use one or the other.

Another more important difference is that a getter/setter method can do more than just setting or getting a field value. If this makes sense for the application in question it may be better to use property based persistence.


Marco
reply
    Bookmark Topic Watch Topic
  • New Topic