Changeset 1779
- Timestamp:
- 02/27/12 15:36:59 (12 years ago)
- Location:
- ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/UserDao.java
r1696 r1779 50 50 */ 51 51 public Number insertUser(RegistryUser user) throws DataAccessException { 52 SimpleJdbcInsert insert = new SimpleJdbcInsert(getDataSource()). 53 withTableName(TABLE_REGISTRY_USER).usingGeneratedKeyColumns( 52 SimpleJdbcInsert insert = new SimpleJdbcInsert(getDataSource()).withTableName(TABLE_REGISTRY_USER).usingGeneratedKeyColumns( 54 53 COLUMN_ID); 55 54 … … 58 57 params.put("principal_name", user.getPrincipalName()); 59 58 return insert.executeAndReturnKey(params); 59 } 60 61 /** 62 * Updates some data stored about the user. At this point only the display name will be updated. ID is taken from 'id' parameter, 63 * not user object. 64 * @param id ID of user to update 65 * @param user object containing new info 66 */ 67 public void updateUser(Number id, RegistryUser user) throws DataAccessException { 68 String updateString = String.format("UPDATE %1$s SET name = ? WHERE %2$s = ?", TABLE_REGISTRY_USER, COLUMN_ID); 69 getSimpleJdbcTemplate().update(updateString, user.getName(), id); 60 70 } 61 71
Note: See TracChangeset
for help on using the changeset viewer.