本文整理汇总了Java中ims.pathways.vo.domain.RTTEventVoAssembler.extractRTTEvent方法的典型用法代码示例。如果您正苦于以下问题:Java RTTEventVoAssembler.extractRTTEvent方法的具体用法?Java RTTEventVoAssembler.extractRTTEvent怎么用?Java RTTEventVoAssembler.extractRTTEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ims.pathways.vo.domain.RTTEventVoAssembler
的用法示例。
在下文中一共展示了RTTEventVoAssembler.extractRTTEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveRTTEvent
import ims.pathways.vo.domain.RTTEventVoAssembler; //导入方法依赖的package包/类
public RTTEventVo saveRTTEvent(RTTEventVo rtteventVo) throws StaleObjectException, UniqueKeyViolationException
{
if(rtteventVo == null)
throw new RuntimeException("Cannot save null RTTEventVo");
if(rtteventVo.isValidated() == false)
throw new CodingRuntimeException("RTTEventVo is not validated");
DomainFactory factory = getDomainFactory();
if (!rtteventVo.getID_RTTEventIsNotNull())
{
List l = factory.find("from RTTEvent rtt where upperName = :rttName", new String[]{"rttName"}, new Object[]{rtteventVo.getName().toUpperCase()});
if (l.size() > 0)
throw new UniqueKeyViolationException("RTT Event record called \"" + rtteventVo.getName() + "\" already exists. Duplicates not allowed.");
List listPasCode = factory.find("from RTTEvent rtt where pASCode = :pascode", new String[]{"pascode"}, new Object[]{rtteventVo.getPASCode()});
if (listPasCode.size() > 0)
throw new UniqueKeyViolationException("RTT Event record with External System code \"" + rtteventVo.getPASCode() + "\" already exists. Duplicates not allowed.");
}
RTTEvent doRTTEvent = RTTEventVoAssembler.extractRTTEvent(factory, rtteventVo);
doRTTEvent.setUpperName(rtteventVo.getName().toUpperCase());
try
{
factory.save(doRTTEvent);
}
catch (UnqViolationUncheckedException e)
{
throw new UniqueKeyViolationException("An RTT Event with this name already exists, Please change", e);
}
return RTTEventVoAssembler.create(doRTTEvent);
}