I want to retrieve Account instances from AccountDTO instance:
This works:
Code:
Example example = Example.create(account)
.ignoreCase()
.excludeZeroes()
.excludeProperty("doNotUse")
.enableLike(MatchMode.ANYWHERE);
session.createCriteria(Account.class).add(example).list();
but what I want to do doesn't: ( the reason is obviously )
Code:
Example example = Example.create(accountDTO)
.ignoreCase()
.excludeZeroes()
.excludeProperty("doNotUse")
.enableLike(MatchMode.ANYWHERE);
session.createCriteria(Account.class).add(example).list();
Is there a way to fix this situation ?
The only one I imagine is creating a new Account, set up the account from the accountDTO and then perform the last code.
Any other solution ?
Regards.