public WhiteBoardConfigVo getEDWhiteBoardConfigByLocation(LocationRefVo locationRef, TrackingAreaRefVo trackingAreaRef) { if(locationRef == null || trackingAreaRef==null) throw new CodingRuntimeException("Can not get EDWhiteBoardConfig value on null locationID or nullAreaID."); StringBuffer hql = new StringBuffer(); hql.append("select whiteBoardCfg from WhiteBoardConfig as whiteBoardCfg "); hql.append("where whiteBoardCfg.eDLocation.id = :locationID and whiteBoardCfg.currentArea.id = :areaID "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"locationID","areaID"}, new Object[] {locationRef.getID_Location(),trackingAreaRef.getID_TrackingArea()}); if (list!=null && list.size()>0) { return WhiteBoardConfigVoAssembler.createWhiteBoardConfigVoCollectionFromWhiteBoardConfig(list).get(0); } return null; }
public WhiteBoardConfigVo getEDWhiteBoardConfigByArea(TrackingAreaRefVo trackingAreaRef) { if(trackingAreaRef==null) throw new CodingRuntimeException("Cannot get EDWhiteBoardConfig value on null AreaID."); StringBuffer hql = new StringBuffer(); hql.append("select whiteBoardCfg from WhiteBoardConfig as whiteBoardCfg "); hql.append("where whiteBoardCfg.currentArea.id = :areaID and (whiteBoardCfg.isRIE is null or whiteBoardCfg.isRIE=0) "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"areaID"}, new Object[] {trackingAreaRef.getID_TrackingArea()}); if (list!=null && list.size()>0) { return WhiteBoardConfigVoAssembler.createWhiteBoardConfigVoCollectionFromWhiteBoardConfig(list).get(0); } return null; }
public WhiteBoardConfigVo save(WhiteBoardConfigVo edWhiteBoardToSave) throws StaleObjectException { if (edWhiteBoardToSave == null) throw new CodingRuntimeException("Cannot save null WhiteBoardConfigVo "); if (!edWhiteBoardToSave.isValidated()) throw new CodingRuntimeException("WhiteBoardConfigVo not Validated"); DomainFactory factory = getDomainFactory(); WhiteBoardConfig domainWhiateBoardConfig = WhiteBoardConfigVoAssembler.extractWhiteBoardConfig(factory, edWhiteBoardToSave); factory.save(domainWhiateBoardConfig); return WhiteBoardConfigVoAssembler.create(domainWhiateBoardConfig); }
public WhiteBoardConfigVoCollection getAllWhiteboardConfigurations() { StringBuffer hql = new StringBuffer(); hql.append("select whiteBoardCfg from WhiteBoardConfig as whiteBoardCfg where whiteBoardCfg.currentArea is not null "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString()); return WhiteBoardConfigVoAssembler.createWhiteBoardConfigVoCollectionFromWhiteBoardConfig(list); }