File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
access-control-spring-security/src/main/java/de/dominikschadow/javasecurity/services Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,7 @@ public class ContactService {
4343 @ PostAuthorize ("returnObject.username == principal.username" )
4444 public Contact getContact (int contactId ) {
4545 return jdbcTemplate .queryForObject ("SELECT * FROM contacts WHERE contact_id = ?" ,
46- new Object []{contactId },
47- (rs , rowNum ) -> {
48- return createContact (rs );
49- });
46+ new Object []{contactId }, (rs , rowNum ) -> createContact (rs ));
5047 }
5148
5249 /**
@@ -60,13 +57,10 @@ public Contact getContact(int contactId) {
6057 @ PreAuthorize ("hasRole('ROLE_USER')" )
6158 @ PostFilter ("filterObject.username == principal.username" )
6259 public List <Contact > getContacts () {
63- return jdbcTemplate .query ("SELECT * FROM contacts" ,
64- (rs , rowNum ) -> {
65- return createContact (rs );
66- });
60+ return jdbcTemplate .query ("SELECT * FROM contacts" , (rs , rowNum ) -> createContact (rs ));
6761 }
6862
69- private Contact createContact (ResultSet rs ) throws SQLException {
63+ private static Contact createContact (ResultSet rs ) throws SQLException {
7064 Contact contact = new Contact ();
7165 contact .setContactId (rs .getInt ("contact_id" ));
7266 contact .setUsername (rs .getString ("username" ));
You can’t perform that action at this time.
0 commit comments