Title:
Bug 77850:So I was playing around with using ORMGetCurrentSession() to do call Save(), SaveOrUpdate(), Merge(), and the other methods that were available
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Mark Mandel / Mark Mandel (mark.mandel)
Created: 06/10/2009
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 238537
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
So I was playing around with using ORMGetCurrentSession() to do call Save(), SaveOrUpdate(), Merge(), and the other methods that were available.
I found that:
piano = new Instrument("Piano", "Plink! Plonk!");
ORMGetSession().save(piano);
Returns the error:
could not determine type of dynamic entity
But if I do:
piano = new Instrument("Piano", "Plink! Plonk!");
//pass in the entity name
ORMGetSession().save("Instrument", piano);
It works perfectly. (and the same applied to merge, saveOrUpdate, etc)
I’m wondering if you could also make the API without the passed in Entity Name work as well?
I’m figuring that we could work it out on the fly if we wanted to:
- Check the CFC Meta Data for an ’entityname’ attribute, if it exists, use that, otherwise, grab the plain Object name from the metadata.name attribute.
But, since you have the SessionWrapper, it would probably be pretty easy for you guys to do exactly the same thing, and make life very simple for those of us that want to access the Session directly, without having to write some sort of proxy.
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3038870
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Mark Mandel
External Customer Email: 3EA9517D445A9E8999201549
External Test Config: 06/10/2009
Attachments:
Comments: