tag:blogger.com,1999:blog-142015575677144593.post8874602625183672159..comments2023-06-05T03:59:31.858-04:00Comments on Ramblings of an Internet MoFo: ColdFusion ORM: Filtering on Composite ObjectsNicholas Tunneyhttp://www.blogger.com/profile/04500115069703249854noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-142015575677144593.post-80969615480522010072013-04-01T09:07:16.658-04:002013-04-01T09:07:16.658-04:00Thanks buddy, you saved me lot of hours....Thanks buddy, you saved me lot of hours....WorldWebWeaverhttps://www.blogger.com/profile/11285056046008275244noreply@blogger.comtag:blogger.com,1999:blog-142015575677144593.post-236411060650988872011-12-11T05:13:48.612-05:002011-12-11T05:13:48.612-05:00how to filter output using Not Equal,
lets say th...how to filter output using Not Equal,<br /><br />lets say that i want to output data from a table where a filed is not null or empty string.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-142015575677144593.post-71546032410923577672011-07-14T21:39:22.606-04:002011-07-14T21:39:22.606-04:00Important to note, as I was just referring back to...Important to note, as I was just referring back to this...<br /><br />When using dot notation to get to a composite object property, the case MUST match the case defined on the property in the CFC.Nicholas Tunneyhttps://www.blogger.com/profile/04500115069703249854noreply@blogger.comtag:blogger.com,1999:blog-142015575677144593.post-2589625045800614722011-02-16T09:33:18.412-05:002011-02-16T09:33:18.412-05:00@namtax If I did:
thisBreed = entityLoadByPk(&quo...@namtax If I did: <br />thisBreed = entityLoadByPk("breed",1)<br /><br />I'd probably just use: thisBreed.getPigs() via the bidirectional relationship for efficiency. <br /><br />To get the other example working where we get by the breed name, we could use:<br />thisBreed = entityLoad("breed", {name='Yorkshire'}, true);<br />thisBreed.getPigs();<br /><br />That's the thing with these ORM functions. I can do the same job plenty of different ways. Not to promote premature optimization, but it really comes down to which one will take the least performance hit. In most apps it won't matter. In my case, the impetus for needing sorting was the ability to filter on multiple composite objects at once, for which HQL was the way to go.Nicholas Tunneyhttps://www.blogger.com/profile/04500115069703249854noreply@blogger.comtag:blogger.com,1999:blog-142015575677144593.post-69290859440382546012011-02-16T05:41:04.889-05:002011-02-16T05:41:04.889-05:00Sorry I mean.
variables.thisBreed = entityLoadByP...Sorry I mean.<br /><br />variables.thisBreed = entityLoadByPk("breed",1)<br />entityLoad('Pig', {breed = variables.thisBreed})namtaxhttp://www.music-explained.comnoreply@blogger.comtag:blogger.com,1999:blog-142015575677144593.post-58474946474177947042011-02-16T04:49:04.716-05:002011-02-16T04:49:04.716-05:00Cant you just do
variables.thisBreed = entityLoa...Cant you just do <br /><br />variables.thisBreed = entityLoadByPk("breed",1)<br />entityLoad('Pig', {breedid = variables.thisBreed})namtaxhttp://www.music-explained.comnoreply@blogger.com