Modified Spring Security's query