I want to get the detail entity of a parent entity with a custom method in this method I want to sort the detail entity random and exclude the details by a condition it's possible in the parent method set the method for get the childs of the parent entity?
softfluent entity related method
107 Views Asked by abigail armijo At
2
There are 2 best solutions below
2

You can create a CFQL method with inline SQL:
<cf:method name="LoadByOrderRandom"
body="LOAD(Order) where Order = @Order order by [newid()]"
checkLevel="None" />
More information about raw methods: http://blog.codefluententities.com/2014/07/03/cfql-raw-methods/
In your example I have order and orderdetail like this:
I need that the order details shoul be order by rownumber in a random sort and I want that I get in the order object when I acces to the detail like Order.OrderDetails I get the orderdetails in random I have a method that returns the orderdetail in random but I don't set how set in the graphical design to set my method for get the orderdetails list collection. Other dude I try to add a cfl method for order random something like this in the order detail object
and get a random order but I get and error so I add a partial class to order by random and add for example an product id like this a)2 b) 1