/** * Search for AMP * */ public AMPVoCollection searchAMPByName(String name) throws ims.domain.exceptions.DomainInterfaceException { if(name == null || name.trim().length() == 0) return null; return AMPVoAssembler.createAMPVoCollectionFromAMP(getDomainFactory().find("from AMP am WHERE am.name like '" + name + "%'")); }
public IDMDValue[] searchAMP(IDMDValue vmp) throws DomainInterfaceException { if(vmp == null || vmp.getIDMDValueId() == null || vmp.getIDMDValueType() != DMDType.VMP) throw new DomainInterfaceException("Invalid VMP reference"); AMPVoCollection result = AMPVoAssembler.createAMPVoCollectionFromAMP(getDomainFactory().find("from AMP vm WHERE vm.vMP.id = " + vmp.getIDMDValueId())); if(result != null) return result.toIDMDValueArray(); return new IDMDValue[] {}; }
public AMPVo getAMP(String ampProductId) throws DomainInterfaceException { if(ampProductId == null) throw new DomainInterfaceException("Invalid AMP reference"); AMPVoCollection ampCol = AMPVoAssembler.createAMPVoCollectionFromAMP(getDomainFactory().find("from AMP amp WHERE amp.productIdentifier = '" + ampProductId + "'")); if (ampCol != null && ampCol.size() > 0) return ampCol.get(0); else return null; }