Spring Security working with database