switch (attrType) { case EMAIL: violation = checkEmail(entity, attribute, entityType); break; case BOOL: violation = checkBoolean(entity, attribute, entityType); break; case DATE: violation = checkDate(entity, attribute, entityType); break; case DATE_TIME: violation = checkDateTime(entity, attribute, entityType); break; case DECIMAL: violation = checkDecimal(entity, attribute, entityType); break; case HYPERLINK: violation = checkHyperlink(entity, attribute, entityType); break; case INT: violation = checkInt(entity, attribute, entityType); if ((violation == null) && (attribute.getRange() != null)) { violation = checkRange(entity, attribute, entityType); violation = checkLong(entity, attribute, entityType); if ((violation == null) && (attribute.getRange() != null)) { violation = checkRange(entity, attribute, entityType); violation = checkEnum(entity, attribute, entityType);
private DataSet createDerivedDataSets(String userName, Integer targetDataSetId, List<Integer> sourceDataSetIds) { DataSet targetDataSet = dataService.findOne(DataSet.ENTITY_NAME, targetDataSetId, DataSet.class); DataSet derivedDataSet = new DataSet(); derivedDataSet.setIdentifier(createDerivedDataSetIdentifier(userName, targetDataSet.getId().toString(), sourceDataSetIds)); derivedDataSet.setName(createDerivedDataSetName(userName, targetDataSet.getName())); derivedDataSet.setProtocolUsed(targetDataSet.getProtocolUsed()); dataService.add(DataSet.ENTITY_NAME, derivedDataSet); dataService.getCrudRepository(DataSet.ENTITY_NAME).flush(); if (!dataService.hasRepository(derivedDataSet.getIdentifier())) { dataService.addRepository(new OmxRepository(dataService, searchService, derivedDataSet.getIdentifier(), new DefaultEntityValidator(dataService, new EntityAttributesValidator()))); } return derivedDataSet; }
dataService.getCrudRepository(DataSet.ENTITY_NAME).flush(); dataService.addRepository(new OmxRepository(dataService, searchService, identifier, new DefaultEntityValidator(dataService, new EntityAttributesValidator())));