Closed chrismayer closed 11 years ago
Thanks, @chrismayer.
Can we possibly use the template-variant for both return type and parameter type of
public List<Object> getEntitiesByBooleanField(Class<?> clazz, String fieldname, Boolean value)
? Just like we are doing it in createEntity()
?
Please ignore if this is complete nonsense.
Anyway, please merge. I leave it up to you to slightly modify the method-signature if possible at all.
BTW: if we can change this to the template-variant, what would you think of refactoring the other related methods as well?
Yes @marcjansen, you are right. It would be very cool to use generics here. The reason I did it the 'old' way was to have a harmonized method structure for the 'getEntitiesBy'-methods. But maybe it is not that dramatically if there is another method signature for this method. I think the benefit will excuse this.
I recently started to restructure the DB-DAO-methods with Java-generics. Unfortunately I haven't finished yet. So I totally agree to refactor the other methods as well.
The User-Class has been extended by a boolean-field 'active'. This flag could be useful for several use-cases, e.g. for a temporary deletion or deactivation of a user.
A new web-interface returning all active user is also included. Therefore a new DB-DAO method (getEntitiesByBooleanField) has been implemented as well.