sjhyam wrote:
If you set the hibernate-mapping default-access="property", you can access the model class from Hibernate with out declaring getter and setter methods.
Hmm. After reading your post I re-read some pages in the 2007 Java Persistence book and think you meant access="field"?
All my entity classes dervive from a @MappedSuperclass annotated base class that has an Id declared as:
Code:
@Id
@GeneratedValue( strategy=GenerationType.IDENTITY)
public Integer Id;
I believe this means that Hibernate will access my entities through direct field access.
Anyhow this leaves the original problem that a proxied entity instance does not backfill public mapped fields even after it performs a just-in-time hydration from the database. I am beginning to think this is by design and I will have to retrofit getters and setters into my domain model.