You don't need this in the DAO, dao should remain with a single saveuser(User, String) and act according to if password is null or not, so remove createUser and saveUser(User)