Hibernate version:3.0.5 (with EHCache)
A general question.
Hi everone.
Mapping and (second-level-)caching are working fine, but....
Imagine two small beans with getters and setters, let's say "PersonBean" and "ContractBean".
Attributes of PersonBean:
1. String name
2. Integer age
3. ContractBean contract
Attributes of ContractBean:
1. Integer contractType
2. Boolean isValid
3. Date expiryDate
Let's say "name" and "age" are gathered from a database with hibernate from a database.
The information for the ContractBean is gathered by calling a native program in the getContact-method of the PersonBean.
"Name" and "age" are cached well, but the "contract" isn't, so the native program has to be called every time (it shouldn't ;-)
How to add this one (not mapped) attribute "contract" to the cache ?
Or is there a possibility to do this by modifing the mapping, although this information isn't stored in a database ?
Thanks for any answers in advance
|