AccountServiceBean.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:oscm 作者:
@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void checkDistinguishedName(Organization organization)
        throws DistinguishedNameException {

    String dn = organization.getDistinguishedName();
    if (dn != null && dn.length() > 0) {
        Query query = dm
                .createNamedQuery("Organization.countOrgsWithSameDN");
        query.setParameter("distinguishedName", dn);
        query.setParameter("organization", organization);
        Long result = (Long) query.getSingleResult();
        if (result.longValue() > 0) {
            DistinguishedNameException e = new DistinguishedNameException();
            logger.logWarn(Log4jLogger.SYSTEM_LOG, e,
                    LogMessageIdentifier.WARN_DUPLICATE_ORG_WITH_DISTINGUISHED_NAME,
                    dn);
            throw e;
        }
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号