Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0.2
-
Component/s: None
-
Labels:None
Description
Person hasMany Things
Thing belongsTo Person
You should be able to access the id of the Person a Thing belongs to without having to load the entire Person object since it exists in the Things database record
possible syntax
myThing.personId
myThing.properties['personId'[
My only concern is creating a syntax that works when the Thing belongsTo two different Person objects.
I suggest the best syntax should be normal property access, such as thing2.person.id. Hibernate already do that for proxy association.
please check http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-fetching-proxies
in section 19.1
"Proxy fetching - a single-valued association is fetched when a method other than the identifier getter is invoked upon the associated object."
an interesting thing is when i access thing2.person.class. GORM also load the person record from database.
WangQi