|[CDO] Comparing object ids with OCL query [message #987766]
||Wed, 28 November 2012 02:21
| Warwick Burrows
Registered: July 2009
Location: Austin, TX
How would I write an OCL query to compare CDO model objects to determine whether one is the same instance as the other. The same in this case would mean they have the same cdo id. I'm after a query something like this:
MyCompany.allInstances()->select(e:MyCompany|e.shippingInfo = infoObject)
Where MyCompany contains an uncontained reference to a model object of type ShippingInfo which is called "shippingInfo" and I want to fetch all the MyCompany objects that have a specific instance of the ShippingInfo object called "infoObject" that has been reused among multiple instances of MyCompany. Is there a way to do an object comparison to determine if they are the same model object? I've tried doing the above query but got an illegal parameter exception. I also tried passing the CDOID object for infoObject instead but got the same error. Any suggestions would be appreciated.
One added question: Will the ocl query handling accept parameter types other than string? So far I've been using string parameter values and not had any trouble. But it doesn't seem to like CDOID objects or Long parameters.
[Updated on: Wed, 28 November 2012 02:29]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.11979 seconds