예제 #1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.salesmanager.core.service.customer.impl.dao.ICustomerInfoDao#saveOrUpdate
  * (com.salesmanager.core.entity.customer.CustomerInfo)
  */
 public void saveOrUpdate(CustomerInfo instance) {
   try {
     super.getHibernateTemplate().saveOrUpdate(instance);
   } catch (RuntimeException re) {
     log.error("attach failed", re);
     throw re;
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see
  * com.salesmanager.core.service.merchant.impl.IMerchantUserInformationDao
  * #merge(com.salesmanager.core.entity.merchant.MerchantUserInformation)
  */
 public void saveOrUpdate(MerchantUserInformation instance) {
   try {
     super.getHibernateTemplate().saveOrUpdate(instance);
   } catch (RuntimeException re) {
     log.error("saveOrUpdate failed", re);
     throw re;
   }
 }
  public void saveAccessToken(
      String tokenId,
      byte[] token,
      String authenticationId,
      String userId,
      String clientId,
      byte[] authentication,
      String refreshToken) {
    OAuth2ProviderAccessToken accessToken = getAccessTokenById(tokenId);

    if (accessToken == null) {
      accessToken = new OAuth2ProviderAccessToken(tokenId);
    }
    accessToken.setToken(token);
    accessToken.setAuthenticationId(authenticationId);
    accessToken.setUserId(userId);
    accessToken.setClientId(clientId);
    accessToken.setAuthentication(authentication);
    accessToken.setRefreshToken(refreshToken);
    super.getHibernateTemplate().saveOrUpdate(accessToken);
  }