Public class RechargeApply extends Domain {
Private static final long serialVersionUID=1785331450982369268 l;
Private RechargeStatusEnum status;
2, the query assembled:
Predicate Predicate=builder. Conjunction (); Dynamic SQL expression//
List
If (dto. GetStartTime ()!=null & amp; & Dtos. GetEndTime ()!=null) {
ExpressionList. Add (builder. Between (root) get (" createDate "), a dto. GetStartTime (), dto. GetEndTime ()));
}
If (StringUtils. IsNotEmpty (dto. GetRechargeType ())) {
ExpressionList. Add (builder. Equal (root) get (" rechargeType "),
RechargeTypeEnum. StringOf (dto. GetRechargeType ())));
}
If (StringUtils. IsNotEmpty (dto. GetStatus ())) {
ExpressionList. Add (builder. Equal (root) get (" status "), RechargeStatusEnum. StringOf (dto) getStatus ())));
}
Error:
Java. Lang. IllegalArgumentException: Unable to locate the Attribute with the the given name [status] on this ManagedType
What a great god, please help to see what's going on?
CodePudding user response:
Has been resolvedExpressionList. Add (builder. Equal (root. & lt; String> Get (" rechargeType "), RechargeTypeEnum stringOf (dto) getRechargeType ())));