SimpleService.java 文件源码

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

项目:bamboobsc 作者:
@SuppressWarnings("unchecked")
@ServiceMethodAuthority(type={ServiceMethodType.SELECT})
@Transactional(
        propagation=Propagation.REQUIRES_NEW, 
        isolation=Isolation.READ_COMMITTED, timeout=25, readOnly=true)
public DefaultResult<E> findEntityByOid(E object) throws ServiceException, Exception {      
    if (object==null || !(object instanceof BaseEntity) ) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.OBJ_NULL));
    }
    DefaultResult<E> result=new DefaultResult<E>();
    try {           
        E entityObject=this.findByOid(object);  
        if (entityObject!=null && !StringUtils.isBlank( ((BaseEntity<String>)entityObject).getOid() ) ) {
            result.setValue(entityObject);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (result.getValue() == null) {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
    }
    return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号