My Controller code:
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
ObjectReader objectReader = objectMapper.reader(User.class);
.....
....
response.setData(userControllerDao.updateUserDao(user, id));
My Dao code:
public List<User> updateUserDao(String userName) {
if(! userName.equalsIgnoreCase("")){
String split[] = userName.split(",");
for(String s: split){
userInfoQuery.field(Constant.USER_ID).equal(s.toString());
}
}
......
return;
I am little bit confused here in coding guidlines. As per MVC architecture I should have write business logic in controller. What about this splitting / null checking query in Dao? They should have move to Controller side?
If yes, then I still need to pass a List / String in Dao and split it again here. Does it make any sense to move them to Controller side?