Ich habe eine original Cayenne ExpressionHashMap nach Cayenne Expression
(effectiveDate >= 01/01/2015) and ((specialFeaturesString like "*808*") and ((amortizationType = "05") or (amortizationType = "06")) and (loanType = 2))
Es gibt eine util Methode in meiner Code-Basis, die zu einem HashMap obigen Ausdruck umwandelt. Ich durchquere die Karte und konvertiere in das JSON-Format und führe diesen JSON in jquery QueryBuilder ein. Ich die JSON ändern in UI-Ebene und mit Jackson die JSON in eine HashMap Die HashMap SYSOUT ist wie unten
{condition=AND, rules=[{id=effectiveDate, field=effectiveDate, type=date, input=text, operator=greater_or_equal, value=04/05/2016}, {condition=AND, rules=[{id=specialFeaturesString, field=specialFeaturesString, type=string, input=text, operator=contains, value="*808*"}, {condition=OR, rules=[{id=amortizationType, field=amortizationType, type=string, input=select, operator=equal, value=05}, {id=amortizationType, field=amortizationType, type=string, input=select, operator=equal, value=06}]}, {id=loanType, field=loanType, type=string, input=select, operator=equal, value=2}]}]}
Ich brauche die HashMap zu durchqueren und wandeln es Expression nach Cayenne.
sollte das Endergebnis
sein(effectiveDate >= 04/05/2016) and ((specialFeaturesString like "*808*") and ((amortizationType = "05") or (amortizationType = "06")) and (loanType = 2))
Bitte geben Sie den Code