0

Why isnt it possible to access transient fields (or fields annotated with @Transient) with hibernates metadata API? Shouldn't PersistentClass#getProperties include all fields of the entity regardless of its annotations or field modifications (because its a metadata layer)?

JWill
  • 105
  • 11

1 Answers1

0

A similar question would be: Why is it not possible to turn screws with a hammer? Simply, it would be unnecessary for Hibernate to store these extra information which it would never use and would never care of.

If you want dynamic access to those fields, then Hibernate mapping files are wrong place to look for them, you should probably use Java reflection.

Community
  • 1
  • 1
Dragan Bozanovic
  • 23,102
  • 5
  • 43
  • 110
  • 1
    Wow .. What an answer!!! I was digging in to search how hibernate ignores and what are more reasons it does so... after reading the answer it sounds foolish.. :-P – Viraj Nalawade Jun 10 '15 at 14:54