public ServiceActivityVo checkForServiceActivityUsingChangedProcedure(ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if( activityRefVo == null ) throw new DomainRuntimeException("checkForServiceActivityUsingChangedProcedure : activityRefVo is Null."); //wdev3999 - ignore inactive records in this check java.util.List servactList = factory.find("from ServiceActivity servact join servact.taxonomyMap tax where servact.activity.id = :activityid and tax.taxonomyName = :taxname and servact.isActive = :isActive", new String[]{"activityid", "taxname", "isActive"}, new Object[]{activityRefVo.getID_Activity(), getDomLookup(TaxonomyType.EXCH), Boolean.TRUE}); ServiceActivityVoCollection coll = ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); if(coll != null && coll.size() > 0) return coll.get(0); return null; }
public void removeServiceActivity(ims.core.vo.ServiceActivityVo voServiceActivity) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException { DomainFactory factory = getDomainFactory(); ServiceActivity doServiceActivity = ServiceActivityVoAssembler.extractServiceActivity(factory, voServiceActivity); try { factory.delete(doServiceActivity); } catch (DomainRuntimeException e) // SN: catching // DomainRuntimeException here as // this is what Hib is returning // with e.getCause() = // ConstrainViolationException { throw new UniqueKeyViolationException(e.getMessage()); } }
public ServiceActivityVo getServiceActivity(ServiceRefVo serviceRefVo, ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if ((serviceRefVo == null) || (activityRefVo == null)) throw new DomainRuntimeException("getServiceActivity : Either serviceRefVo or activityRefVo are Null."); // java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid and servact.activity.id = :activityid", new String[]{"serviceid", "activityid"}, new Object[]{serviceRefVo.getID_Service(), activityRefVo.getID_Activity()}); //entpf473 wdev-6344 java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid and servact.activity.id = :activityid and servact.isActive = :isAct", new String[]{"serviceid", "activityid", "isAct"}, new Object[]{serviceRefVo.getID_Service(), activityRefVo.getID_Activity(), Boolean.TRUE}); ServiceActivityVoCollection coll = ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); if (coll != null && coll.size() > 0) return coll.get(0); return null; }
public ServiceActivityVoCollection listServiceActivity(Integer voServiceId) { DomainFactory factory = getDomainFactory(); if (voServiceId != null) { java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid", new String[]{"serviceid"}, new Object[]{voServiceId}, 1000); return ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); } return null; }
public ServiceActivityVoCollection listServiceActivity(ServiceShortVo voService) { DomainFactory factory = getDomainFactory(); if (voService == null) return ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(factory.listDomainObjects(ServiceActivity.class)).sort(); if (voService.getID_ServiceIsNotNull()) { java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid", new String[]{"serviceid"}, new Object[]{voService.getID_Service()}, 1000); return ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); } return null; }
public ServiceActivityVoCollection listProcedureinServiceActivity(ActivityVo activityVo) { DomainFactory factory = getDomainFactory(); String hql = " from ServiceActivity serActivity "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if(activityVo != null) { if(activityVo.getIsActiveIsNotNull()) { condStr.append(andStr + " serActivity.isActive = :isActive"); markers.add("isActive"); values.add(activityVo.getIsActive()); andStr = " and "; } if(activityVo.getNameIsNotNull() && !activityVo.getID_ActivityIsNotNull()) { condStr.append(andStr + " upper(serActivity.activity.name) like :activityName"); markers.add("activityName"); values.add("%" + activityVo.getName().toUpperCase() + "%"); andStr = " and "; } else if(activityVo.getID_ActivityIsNotNull()) { condStr.append(andStr + "serActivity.activity.id = :activityId"); markers.add("activityId"); values.add(activityVo.getID_Activity()); andStr = " and "; } } if (andStr.equals(" and ")) hql += " where "; hql += condStr.toString(); return ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(factory.find(hql, markers, values)).sort(); }