It all depends on whether you want a class that is searchable, and is Dao, in other words, if your Searchable class should also be Dao. If in this case I would use a general approach to make your Tao accessible.
interface SearchableDao<Entity, Criteria> extends SomeDao<Entity> { List<Entity> findByCriteria(Criteria criteria); }
Your class can now be a simple Dao or SearchableDao. SearchableDao is also a simple tao.
class MoneyDao implements SearchableDao<MoneyEntity, MoneyCriteria> { List<MoneyEntity> findByCriteria(MoneyCriteria criteria) {...} }
Lynch source share