オリジナルのカイエン エクスプレッションを持っています
(effectiveDate >= 01/01/2015) and ((specialFeaturesString like "*808*") and ((amortizationType = "05") or (amortizationType = "06")) and (loanType = 2))
私のコードベースには、上記の式を HashMap に変換する util メソッドがあります。マップを走査して JSON 形式に変換し、その JSON を jquery QueryBuilder にフィードします。UIレイヤーでJSONを変更し、Jacksonを使用してJSONをHashMapに取得します HashMap sysoutは以下のとおりです
{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}]}]}
HashMap をトラバースして、それを Cayenne Expression に変換する必要があります。
最終結果は
(effectiveDate >= 04/05/2016) and ((specialFeaturesString like "*808*") and ((amortizationType = "05") or (amortizationType = "06")) and (loanType = 2))
コードを入力してください