Menu

#29 "<econdition..." does not work for extended EntityFind

v1.0_(example)
open
nobody
EntityFind (1)
5
2014-08-28
2013-03-07
Al Byers
No

I have this in my screen transition def:
<entity-find entity-name="ContactRelationshipDyn" list="clientList">
<econdition field-name="partyId" value="${ec.user.userAccount.partyId}"/>
</entity-find>

The ftl script turns it into:

 clientList_xafind = ec.entity.makeFind("ContactRelationshipDyn")
         .condition(ec.entity.conditionFactory.makeActionCondition("partyId", "equals", "partyId", "${ec.user.userAccount.partyId}", null, false, false, false))

which throws this error:

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'partyId = 86d5c172-085e-41d8-84a2-46a089c64ac3' with class 'org.moqui.impl.entity.condition.FieldValueCondition' to class 'org.moqui.impl.entity.dynamodb.condition.DynamoDBEntityConditionImplBase'

It needs to have a "entity aware" method of generating the FieldValueCondition just as EntityFacade has for creating EntityValues and EntityFinds. It looks like that would be a little difficult to do considering the nature of the ftl code, but it will be necessary for extending the Entity markup to non-SQL databases. Don't think it is worth it just for my situation - I can just use groovy script instead, but it would be nice to have Moqui work almost seamlessly with DynamoDB.

Discussion

  • David E. Jones

    David E. Jones - 2013-03-22

    Is there a reason your DynamoDB classes can't use the existing EntityConditionImplBase subclasses? You wouldn't use the makeSqlWhere() method, but the other data needed to evaluate the conditions is all there.

     
  • David E. Jones

    David E. Jones - 2013-03-22

    Forgot to mention, if there is a way you'd like this to work feel free to submit a patch and I'll look it over.

     

Log in to post a comment.