예제 #1
0
 @Override
 public UserAccount create(UserAccount userAccount) {
   UserAccount createdUserAccount = null;
   Number generatedId =
       extendedJDBCTemplate.addAndReturnGeneratedKey(CREATE, userAccountMapper, userAccount);
   if (generatedId != null) {
     createdUserAccount = cloneUserAccount(userAccount);
     createdUserAccount.setUserAccountId(generatedId.longValue());
   }
   return userAccount;
 }
예제 #2
0
 @Override
 public boolean isUserAccountExist(long userAccountId) {
   return extendedJDBCTemplate.queryForObject(IS_USER_ACCOUNT_EXIST, Integer.class, userAccountId)
       > 0;
 }
예제 #3
0
 @Override
 public boolean update(UserAccount userAccount) {
   return extendedJDBCTemplate.updateEntity(UPDATE, userAccountMapper, userAccount) > 0;
 }
예제 #4
0
 @Override
 public boolean deleteUserAccountByUser(long userId) {
   return extendedJDBCTemplate.update(DELETE_BY_USER_ID, userId) > 0;
 }
예제 #5
0
 @Override
 public boolean deleteUserAccountById(long userAccountId) {
   return extendedJDBCTemplate.update(DELETE_BY_ID, Integer.class, userAccountId) > 0;
 }
예제 #6
0
 @Override
 public UserAccount getUserAccountById(long userAccountId) {
   return extendedJDBCTemplate.queryForObject(GET_BY_ID, userAccountMapper, userAccountId);
 }