I want to know what is the best approach to find if an object has a children that has a value in a clumn.
I have this relationship User.cfc:
`
property name=“sites” singularName=“site” notnull=“true” fieldtype=“many-to-many” type=“array” lazy=“extra”
cfc=“Site” fkcolumn=“FK_siteID” linktable=“userSites” inversejoincolumn=“FK_userID”;
`
Site.cfc
`
// Properties
property name=“siteID” fieldtype=“id” generator=“native” setter=“false”;
property name=“siteUrl” length=“100” notnull=“true”;
`
Now I have my domain name “mydomain.com” and wanna know if a user has a relationship with this site.
How can if user has a site that has siteUrl = “mydomain.com”?
I should use userService.findIt(“from User as u where u.FK_siteID=‘mydomain.com’”);
I should go with criteriabuilder?