Revision 44761
Added by Sofia Baltzi almost 8 years ago
modules/uoa-user-management/trunk/src/main/java/eu/dnetlib/openaire/user/dao/SQLMigrationUserDAO.java | ||
---|---|---|
35 | 35 |
return (List<MigrationUser>) executeQuery(FETCH_ALL); |
36 | 36 |
} |
37 | 37 |
|
38 |
public MigrationUser fetchById(int id) |
|
38 |
public MigrationUser fetchById(final int id)
|
|
39 | 39 |
throws SQLException |
40 | 40 |
{ |
41 |
List<MigrationUser> users = executeQuery(FETCH_BY_ID); |
|
41 |
List<MigrationUser> users = executeQuery(FETCH_BY_ID, new Statement.Initializer() { |
|
42 |
@Override |
|
43 |
public void prepare(PreparedStatement stmt) throws SQLException { |
|
44 |
stmt.setInt(1, id); |
|
45 |
} |
|
46 |
}); |
|
42 | 47 |
|
43 | 48 |
if (users.isEmpty()) |
44 | 49 |
return null; |
... | ... | |
74 | 79 |
|
75 | 80 |
if (users.isEmpty()) |
76 | 81 |
return null; |
77 |
System.out.println("tralal"); |
|
82 |
|
|
78 | 83 |
return users.get(0); |
79 | 84 |
} |
80 | 85 |
|
Also available in: Unified diff
Fix fetchById