Skip navigation.

MG:Unity - Calling your own custom reactor gateway methods using a Generic list

| |

Are you guys using the ModelGlue generic list? A basic generic list (using reactor as the orm) calls the getByFields() method in the reactor gateway for the object you specify.

for example, if you broadcast this message in your eventhandler:

<message name="modelglue.genericList">
<argument name="object" value="user" />
<argument name="criteria" value="userID" />
</message>

Would call getByFields(UserID={userIDValueInTheViewState})

and stuff the results into the viewstate.



Well, If you need complex query results (joins etc), you can specify the gateway method to call and modelglue will pass on the criteria as arguments to your custom method.

<message name="modelglue.genericList">
<argument name="object" value="user" />
<argument name="criteria" value="userID" />
<argument name="gatewayMethod" value="getUserInfo" />
</message>

Then ModelGlue will take the results and stuff them into the viewstate just like any other generic list.