conflict_resolution
stringlengths
27
16k
<<<<<<< Attribute xrefAttr = when(mock(Attribute.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(XREF); ======= AttributeMetaData xrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(attrType); >>>>>>> Attribute xrefAttr = when(mock(Attribute.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(attrType); <<<<<<< Attribute xrefAttr = when(mock(Attribute.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(XREF); ======= AttributeMetaData xrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(attrType); >>>>>>> Attribute xrefAttr = when(mock(Attribute.class).getName()).thenReturn(xrefAttrName).getMock(); when(xrefAttr.getDataType()).thenReturn(attrType); <<<<<<< Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(MREF); ======= AttributeMetaData mrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType); >>>>>>> Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType); <<<<<<< Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(MREF); ======= AttributeMetaData mrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType); >>>>>>> Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType); <<<<<<< Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(MREF); ======= AttributeMetaData mrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType); >>>>>>> Attribute mrefAttr = when(mock(Attribute.class).getName()).thenReturn(mrefAttrName).getMock(); when(mrefAttr.getDataType()).thenReturn(attrType);
<<<<<<< DefaultEntityMetaData metaData = new DefaultEntityMetaData(name); metaData.addAttributeMetaData(new DefaultAttributeMetaData(ID, FieldTypeEnum.STRING)); ======= DefaultEntityMetaData metaData = new DefaultEntityMetaData(name, MapEntity.class); >>>>>>> DefaultEntityMetaData metaData = new DefaultEntityMetaData(name, MapEntity.class); metaData.addAttributeMetaData(new DefaultAttributeMetaData(ID, FieldTypeEnum.STRING));
<<<<<<< import static org.molgenis.data.meta.model.AttributeMetaDataMetaData.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES; import static org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_META_DATA; ======= import static org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityMetaDataMetaData.ATTRIBUTES; import static org.molgenis.data.meta.model.EntityMetaDataMetaData.ENTITY_META_DATA; >>>>>>> import static org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES; import static org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_META_DATA; <<<<<<< Entity EntityTypeEntity = dataService.findOneById(ENTITY_META_DATA, entityType.getName()); Optional<Entity> result = stream(EntityTypeEntity.getEntities(ATTRIBUTES).spliterator(), false) .filter(att -> attributeName.equals(att.getString(AttributeMetaDataMetaData.NAME))).findFirst(); ======= Entity entityMetaDataEntity = dataService.findOneById(ENTITY_META_DATA, entityMetaData.getName()); Optional<Entity> result = stream(entityMetaDataEntity.getEntities(ATTRIBUTES).spliterator(), false) .filter(att -> attributeName.equals(att.getString(AttributeMetadata.NAME))).findFirst(); >>>>>>> Entity entityTypeEntity = dataService.findOneById(ENTITY_META_DATA, entityType.getName()); Optional<Entity> result = stream(entityTypeEntity.getEntities(ATTRIBUTES).spliterator(), false) .filter(att -> attributeName.equals(att.getString(AttributeMetadata.NAME))).findFirst(); <<<<<<< public void addAttributeTag(EntityType entityType, SemanticTag<AttributeMetaData, LabeledResource, LabeledResource> tag) ======= public void addAttributeTag(EntityMetaData entityMetaData, SemanticTag<Attribute, LabeledResource, LabeledResource> tag) >>>>>>> public void addAttributeTag(EntityType entityType, SemanticTag<Attribute, LabeledResource, LabeledResource> tag)
<<<<<<< ======= @Value("${vcf-validator-location:@null}") private String vcfValidatorLocation; /** * Needed to make @Value annotations with property placeholders work! * * @see https * ://stackoverflow.com/questions/17097521/spring-3-2-value-annotation-with-pure-java-configuration-does-not * -work-but-env */ @Bean public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() { PropertySourcesPlaceholderConfigurer result = new PropertySourcesPlaceholderConfigurer(); result.setNullValue("@null"); return result; } @Bean public CmdLineAnnotator cmdLineAnnotator() { return new CmdLineAnnotator(); } @Bean public VcfValidator vcfValidator() { return new VcfValidator(vcfValidatorLocation); } >>>>>>> @Value("${vcf-validator-location:@null}") private String vcfValidatorLocation; /** * Needed to make @Value annotations with property placeholders work! * * @see https * ://stackoverflow.com/questions/17097521/spring-3-2-value-annotation-with-pure-java-configuration-does-not * -work-but-env */ @Bean public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() { PropertySourcesPlaceholderConfigurer result = new PropertySourcesPlaceholderConfigurer(); result.setNullValue("@null"); return result; } @Bean public CmdLineAnnotator cmdLineAnnotator() { return new CmdLineAnnotator(); } @Bean public VcfValidator vcfValidator() { return new VcfValidator(vcfValidatorLocation); } <<<<<<< @Bean public Entity caddAnnotatorSettings() { return new MapEntity(); } @Bean public Entity snpEffAnnotatorSettings() { return new MapEntity(); } @Bean public Entity goNLAnnotatorSettings() { return new MapEntity(); } @Bean public Entity thousendGenomesAnnotatorSettings() { return new MapEntity(); } @Bean public Entity CGDAnnotatorSettings() { return new MapEntity(); } @Bean public Entity clinvarAnnotatorSettings() { return new MapEntity(); } @Bean public Entity dannAnnotatorSettings() { return new MapEntity(); } @Bean public Entity exacAnnotatorSettings() { return new MapEntity(); } @Bean public Entity fitConAnnotatorSettings() { return new MapEntity(); } ======= >>>>>>> @Bean public Entity caddAnnotatorSettings() { return new MapEntity(); } @Bean public Entity snpEffAnnotatorSettings() { return new MapEntity(); } @Bean public Entity goNLAnnotatorSettings() { return new MapEntity(); } @Bean public Entity thousendGenomesAnnotatorSettings() { return new MapEntity(); } @Bean public Entity CGDAnnotatorSettings() { return new MapEntity(); } @Bean public Entity clinvarAnnotatorSettings() { return new MapEntity(); } @Bean public Entity dannAnnotatorSettings() { return new MapEntity(); } @Bean public Entity exacAnnotatorSettings() { return new MapEntity(); } @Bean public Entity fitConAnnotatorSettings() { return new MapEntity(); }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< * @param entityType {@link EntityType} for the existing repository * @param attributeMetaDataFactory ======= * @param entityMetaData {@link EntityMetaData} for the existing repository * @param attributeFactory >>>>>>> * @param entityType {@link EntityType} for the existing repository * @param attributeFactory <<<<<<< public static EntityType addAnnotatorMetaDataToRepositories(EntityType entityType, AttributeMetaDataFactory attributeMetaDataFactory, RepositoryAnnotator annotator) ======= public static EntityMetaData addAnnotatorMetaDataToRepositories(EntityMetaData entityMetaData, AttributeFactory attributeFactory, RepositoryAnnotator annotator) >>>>>>> public static EntityType addAnnotatorMetaDataToRepositories(EntityType entityType, AttributeFactory attributeFactory, RepositoryAnnotator annotator) <<<<<<< private static void createCompoundForAnnotator(EntityType entityType, AttributeMetaDataFactory attributeMetaDataFactory, RepositoryAnnotator annotator, List<AttributeMetaData> attributeMetaDatas, String compoundName) ======= private static void createCompoundForAnnotator(EntityMetaData entityMetaData, AttributeFactory attributeFactory, RepositoryAnnotator annotator, List<Attribute> attributes, String compoundName) >>>>>>> private static void createCompoundForAnnotator(EntityType entityType, AttributeFactory attributeFactory, RepositoryAnnotator annotator, List<Attribute> attributes, String compoundName) <<<<<<< AttributeMetaData finalCompound = compound; attributeMetaDatas.stream().filter(part -> entityType.getAttribute(part.getName()) == null) ======= Attribute finalCompound = compound; attributes.stream().filter(part -> entityMetaData.getAttribute(part.getName()) == null) >>>>>>> Attribute finalCompound = compound; attributes.stream().filter(part -> entityType.getAttribute(part.getName()) == null) <<<<<<< * @param entityTypeFactory factory for molgenis EntityType * @param attributeMetaDataFactory factory for molgenis EntityType ======= * @param entityMetaDataFactory factory for molgenis entityMetaData * @param attributeFactory factory for molgenis entityMetaData >>>>>>> * @param entityTypeFactory factory for molgenis entityType * @param attributeFactory factory for molgenis entityType <<<<<<< entityTypeFactory, attributeMetaDataFactory)) ======= entityMetaDataFactory, attributeFactory)) >>>>>>> entityTypeFactory, attributeFactory)) <<<<<<< List<AttributeMetaData> outputMetaData = getOutputAttributeMetaDatasForAnnotator(annotator, entityTypeFactory, attributeMetaDataFactory, attributesToInclude, vcfRepo); ======= List<Attribute> outputMetaData = getOutputAttributeMetadatasForAnnotator(annotator, entityMetaDataFactory, attributeFactory, attributesToInclude, vcfRepo); >>>>>>> List<Attribute> outputMetaData = getOutputAttributeMetadatasForAnnotator(annotator, entityTypeFactory, attributeFactory, attributesToInclude, vcfRepo); <<<<<<< EntityType emd = vcfRepo.getEntityType(); AttributeMetaData infoAttribute = emd.getAttribute(VcfAttributes.INFO); for (AttributeMetaData attribute : annotator.getOutputAttributes()) ======= EntityMetaData emd = vcfRepo.getEntityMetaData(); Attribute infoAttribute = emd.getAttribute(VcfAttributes.INFO); for (Attribute attribute : annotator.getOutputAttributes()) >>>>>>> EntityType entityType = vcfRepo.getEntityType(); Attribute infoAttribute = entityType.getAttribute(VcfAttributes.INFO); for (Attribute attribute : annotator.getOutputAttributes()) <<<<<<< private static List<AttributeMetaData> getOutputAttributeMetaDatasForAnnotator(RepositoryAnnotator annotator, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attributeMetaDataFactory, ======= private static List<Attribute> getOutputAttributeMetadatasForAnnotator(RepositoryAnnotator annotator, EntityMetaDataFactory entityMetaDataFactory, AttributeFactory attributeFactory, >>>>>>> private static List<Attribute> getOutputAttributeMetadatasForAnnotator(RepositoryAnnotator annotator, EntityTypeFactory entityTypeFactory, AttributeFactory attributeFactory, List<String> attributesToInclude, VcfRepository vcfRepo) { if (!attributesToInclude.isEmpty()) { checkSelectedOutputAttributeNames(annotator, attributesToInclude, vcfRepo); } // If the annotator e.g. SnpEff creates an external repository, collect the output metadata into an mref // entity // This allows for the header to be written as 'EFFECT annotations: <ouput_attributes> | <ouput_attributes>' List<Attribute> outputMetaData = newArrayList(); if (annotator instanceof RefEntityAnnotator || annotator instanceof EffectsAnnotator) { EntityType effectRefEntity = entityTypeFactory.create().setName(annotator.getSimpleName() + "_EFFECTS"); for (Attribute outputAttribute : annotator.getOutputAttributes()) { effectRefEntity.addAttribute(outputAttribute); } Attribute effect = attributeFactory.create().setName(EFFECT); effect.setDataType(MREF).setRefEntity(effectRefEntity); outputMetaData.add(effect); } else { outputMetaData = annotator.getOutputAttributes(); } return outputMetaData; } private static void checkSelectedOutputAttributeNames(RepositoryAnnotator annotator, <<<<<<< .getAtomicAttributesFromList(vcfRepo.getEntityType().getAtomicAttributes()).stream() .map(AttributeMetaData::getName).collect(Collectors.toList()); ======= .getAtomicAttributesFromList(vcfRepo.getEntityMetaData().getAtomicAttributes()).stream() .map(Attribute::getName).collect(Collectors.toList()); >>>>>>> .getAtomicAttributesFromList(vcfRepo.getEntityType().getAtomicAttributes()).stream() .map(Attribute::getName).collect(Collectors.toList());
<<<<<<< import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; ======= import org.molgenis.auth.SecurityPackage; >>>>>>> import org.molgenis.auth.SecurityPackage; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; <<<<<<< @Mock private Repository<Entity> decoratedRepository; ======= private Repository decoratedRepository; >>>>>>> private Repository decoratedRepository;
<<<<<<< jobExecution.setStartDate(new Date()); jobExecution.setProgressInt(0); ======= jobExecution.setStartDate(Instant.now()); >>>>>>> jobExecution.setStartDate(Instant.now()); jobExecution.setProgressInt(0);
<<<<<<< import org.molgenis.data.meta.AttributeMetaDataRepositoryDecorator; import org.molgenis.data.meta.EntityTypeRepositoryDecorator; ======= import org.molgenis.data.meta.AttributeRepositoryDecorator; import org.molgenis.data.meta.EntityMetaDataRepositoryDecorator; >>>>>>> import org.molgenis.data.meta.AttributeRepositoryDecorator; import org.molgenis.data.meta.EntityTypeRepositoryDecorator; <<<<<<< import static org.molgenis.data.meta.model.AttributeMetaDataMetaData.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_META_DATA; ======= import static org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityMetaDataMetaData.ENTITY_META_DATA; >>>>>>> import static org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA; import static org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_META_DATA; <<<<<<< AttributeMetaDataFactory attrMetaFactory, PasswordEncoder passwordEncoder, EntityTypeMetadata entityTypeMeta, I18nStringMetaData i18nStringMeta, L1Cache l1Cache, L2Cache l2Cache, ======= AttributeFactory attrMetaFactory, PasswordEncoder passwordEncoder, EntityMetaDataMetaData entityMetaMeta, I18nStringMetaData i18nStringMeta, L1Cache l1Cache, L2Cache l2Cache, >>>>>>> AttributeFactory attrMetaFactory, PasswordEncoder passwordEncoder, EntityTypeMetadata entityTypeMeta, I18nStringMetaData i18nStringMeta, L1Cache l1Cache, L2Cache l2Cache, <<<<<<< repo = (Repository<Entity>) (Repository<? extends Entity>) new AttributeMetaDataRepositoryDecorator( (Repository<AttributeMetaData>) (Repository<? extends Entity>) repo, systemEntityTypeRegistry, ======= repo = (Repository<Entity>) (Repository<? extends Entity>) new AttributeRepositoryDecorator( (Repository<Attribute>) (Repository<? extends Entity>) repo, systemEntityMetaDataRegistry, >>>>>>> repo = (Repository<Entity>) (Repository<? extends Entity>) new AttributeRepositoryDecorator( (Repository<Attribute>) (Repository<? extends Entity>) repo, systemEntityTypeRegistry,
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< for (AttributeMetaData mrefAttr : entityType.getAtomicAttributes()) ======= for (Attribute mrefAttr : entityMeta.getAtomicAttributes()) >>>>>>> for (Attribute mrefAttr : entityType.getAtomicAttributes()) <<<<<<< private Multimap<Object, Object> selectMrefIDsForAttribute(EntityType entityType, AttributeType idAttributeDataType, AttributeMetaData mrefAttr, Set<Object> ids, AttributeType refIdDataType) ======= private Multimap<Object, Object> selectMrefIDsForAttribute(EntityMetaData entityMeta, AttributeType idAttributeDataType, Attribute mrefAttr, Set<Object> ids, AttributeType refIdDataType) >>>>>>> private Multimap<Object, Object> selectMrefIDsForAttribute(EntityType entityType, AttributeType idAttributeDataType, Attribute mrefAttr, Set<Object> ids, AttributeType refIdDataType)
<<<<<<< import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType;
<<<<<<< import org.molgenis.data.meta.PackageSearchResultItem; ======= import org.molgenis.data.semantic.UntypedTagService; >>>>>>> import org.molgenis.data.meta.PackageSearchResultItem; <<<<<<< private final MetaDataSearchService metaDataSearchService; ======= private final UntypedTagService tagService; >>>>>>> private final MetaDataSearchService metaDataSearchService; private final UntypedTagService tagService; <<<<<<< public StandardsRegistryController(MetaDataService metaDataService, MetaDataSearchService metaDataSearchService) ======= public StandardsRegistryController(MetaDataService metaDataService, UntypedTagService tagService) >>>>>>> public StandardsRegistryController(MetaDataService metaDataService, UntypedTagService tagService, MetaDataSearchService metaDataSearchService) <<<<<<< this.metaDataSearchService = metaDataSearchService; ======= this.tagService = tagService; >>>>>>> this.metaDataSearchService = metaDataSearchService; this.tagService = tagService; <<<<<<< ======= List<PackageResponse> packageResponses = Lists.newArrayList(Iterables.transform( metaDataService.getRootPackages(), new Function<Package, PackageResponse>() { @Override public PackageResponse apply(Package aPackage) { return new PackageResponse(aPackage.getSimpleName(), aPackage.getDescription(), getEntityNamesInPackage(aPackage.getSimpleName())); } })); int total = packageResponses.size(); >>>>>>> <<<<<<< private final String matchDescription; ======= private final List<String> entitiesInPackage; >>>>>>> private final String matchDescription; private final List<String> entitiesInPackage; <<<<<<< this.matchDescription = matchDescription; ======= this.entitiesInPackage = entitiesInPackage; >>>>>>> this.matchDescription = matchDescription; this.entitiesInPackage = entitiesInPackage; <<<<<<< @SuppressWarnings("unused") public String getMatchDescription() { return matchDescription; } ======= @SuppressWarnings("unused") public List<String> getEntities() { return entitiesInPackage; } >>>>>>> @SuppressWarnings("unused") public String getMatchDescription() { return matchDescription; } public List<String> getEntities() { return entitiesInPackage; }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType;
<<<<<<< /** * Get all possible authorities (roles) for an entity * * @param entityName * @return */ public static List<String> getEntityAuthorities(String entityName) { List<String> authorities = new ArrayList<>(); for (Permission permission : Permission.values()) { String authority = String.format("%s%s_%s", AUTHORITY_ENTITY_PREFIX, permission.name(), entityName.toUpperCase()); authorities.add(authority); } return authorities; } ======= /** * Checks if client session is expired (by checking the requested sessionId). * * * @param request * @return true if session is expired */ public static boolean isSessionExpired(HttpServletRequest request) { return request.getRequestedSessionId() != null && !request.isRequestedSessionIdValid(); } >>>>>>> /** * Get all possible authorities (roles) for an entity * * @param entityName * @return */ public static List<String> getEntityAuthorities(String entityName) { List<String> authorities = new ArrayList<>(); for (Permission permission : Permission.values()) { String authority = String.format("%s%s_%s", AUTHORITY_ENTITY_PREFIX, permission.name(), entityName.toUpperCase()); authorities.add(authority); } return authorities; } /** * Checks if client session is expired (by checking the requested sessionId). * * * @param request * @return true if session is expired */ public static boolean isSessionExpired(HttpServletRequest request) { return request.getRequestedSessionId() != null && !request.isRequestedSessionIdValid(); }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private final EntityTypeFactory entityTypeFactory; private final AttributeMetaDataFactory attributeMetaDataFactory; ======= private final EntityMetaDataFactory entityMetaDataFactory; private final AttributeFactory attributeFactory; >>>>>>> private final EntityTypeFactory entityTypeFactory; private final AttributeFactory attributeFactory; <<<<<<< public HPORepository(File file, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attributeMetaDataFactory) ======= public HPORepository(File file, EntityMetaDataFactory entityMetaDataFactory, AttributeFactory attributeFactory) >>>>>>> public HPORepository(File file, EntityTypeFactory entityTypeFactory, AttributeFactory attributeFactory) <<<<<<< this.entityTypeFactory = entityTypeFactory; this.attributeMetaDataFactory = attributeMetaDataFactory; ======= this.entityMetaDataFactory = entityMetaDataFactory; this.attributeFactory = attributeFactory; >>>>>>> this.entityTypeFactory = entityTypeFactory; this.attributeFactory = attributeFactory; <<<<<<< EntityType entityType = entityTypeFactory.create().setSimpleName("HPO"); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_TERM_COL_NAME)); return entityType; ======= EntityMetaData entityMeta = entityMetaDataFactory.create().setSimpleName("HPO"); entityMeta.addAttribute(attributeFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityMeta.addAttribute(attributeFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityMeta.addAttribute(attributeFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityMeta.addAttribute(attributeFactory.create().setName(HPO_TERM_COL_NAME)); return entityMeta; >>>>>>> EntityType entityType = entityTypeFactory.create().setSimpleName("HPO"); entityType.addAttribute(attributeFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityType.addAttribute(attributeFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityType.addAttribute(attributeFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityType.addAttribute(attributeFactory.create().setName(HPO_TERM_COL_NAME)); return entityType;
<<<<<<< static String getSqlAddColumn(EntityMetaData entityMeta, Attribute attr) ======= /** * Returns SQL string to add a column to an existing table. * * @param entityMeta entity meta data * @param attr attribute * @return SQL string or <code>null</code> if no table changes are required */ static String getSqlAddColumn(EntityMetaData entityMeta, AttributeMetaData attr) >>>>>>> /** * Returns SQL string to add a column to an existing table. * * @param entityMeta entity meta data * @param attr attribute * @return SQL string or <code>null</code> if no table changes are required */ static String getSqlAddColumn(EntityMetaData entityMeta, Attribute attr) <<<<<<< List<Attribute> persistedNonMrefAttrs = getPersistedAttributesNonMref(entityMeta).collect(toList()); ======= List<AttributeMetaData> persistedTableAttrs = getTableAttributes(entityMeta).collect(toList()); >>>>>>> List<Attribute> persistedTableAttrs = getTableAttributes(entityMeta).collect(toList()); <<<<<<< for (Attribute persistedNonMrefAttr : persistedNonMrefAttrs) ======= for (AttributeMetaData persistedTableAttr : persistedTableAttrs) >>>>>>> for (Attribute persistedTableAttr : persistedTableAttrs) <<<<<<< Attribute idAttr = entityMeta.getIdAttribute(); ======= if (attr.isMappedBy()) { entityMeta = attr.getRefEntity(); attr = attr.getMappedBy(); } AttributeMetaData idAttr = entityMeta.getIdAttribute(); >>>>>>> if (attr.isMappedBy()) { entityMeta = attr.getRefEntity(); attr = attr.getMappedBy(); } Attribute idAttr = entityMeta.getIdAttribute(); <<<<<<< Attribute idxAttr = entityMeta.getIdAttribute(); ======= AttributeMetaData idAttr = attr.isMappedBy() ? attr.getRefEntity().getIdAttribute() : entityMeta .getIdAttribute(); >>>>>>> Attribute idAttr = attr.isMappedBy() ? attr.getRefEntity().getIdAttribute() : entityMeta .getIdAttribute(); <<<<<<< static String getJunctionTableSelect(EntityMetaData entityMeta, Attribute attr, int numOfIds) ======= private static boolean isJunctionTableAttribute(AttributeMetaData attr) >>>>>>> private static boolean isJunctionTableAttribute(Attribute attr) <<<<<<< List<Attribute> mrefAttrsInQuery = getMrefQueryAttrs(entityMeta, q); if (!mrefAttrsInQuery.isEmpty()) ======= boolean distinctSelectRequired = isDistinctSelectRequired(entityMeta, q); if (distinctSelectRequired) >>>>>>> boolean distinctSelectRequired = isDistinctSelectRequired(entityMeta, q); if (distinctSelectRequired) <<<<<<< private static String getSqlColumn(EntityMetaData entityMeta, Attribute attr) ======= private static String getSqlOrderColumn(AttributeMetaData attr) { return getSequenceColumnName(attr) + " SERIAL"; } /** * Returns the name of the sequence column of the many to one attribute. * * @param attr many to one attribute * @return sequence column name */ static String getSequenceColumnName(AttributeMetaData attr) { return getColumnName(attr.getMappedBy().getName() + "_order"); } private static String getSqlColumn(EntityMetaData entityMeta, AttributeMetaData attr) >>>>>>> private static String getSqlOrderColumn(Attribute attr) { return getSequenceColumnName(attr) + " SERIAL"; } /** * Returns the name of the sequence column of the many to one attribute. * * @param attr many to one attribute * @return sequence column name */ static String getSequenceColumnName(Attribute attr) { return getColumnName(attr.getMappedBy().getName() + "_order"); } private static String getSqlColumn(EntityMetaData entityMeta, Attribute attr) <<<<<<< Attribute attr = entityMeta.getAttribute(o.getAttr()); if (isMultipleReferenceType(attr)) ======= AttributeMetaData attr = entityMeta.getAttribute(o.getAttr()); if (isJunctionTableAttribute(attr)) >>>>>>> Attribute attr = entityMeta.getAttribute(o.getAttr()); if (isJunctionTableAttribute(attr)) <<<<<<< List<Attribute> mrefAttrsInQuery = getMrefQueryAttrs(entityMeta, q); ======= >>>>>>> <<<<<<< Attribute mrefAttr = mrefAttrsInQuery.get(i); from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(idAttribute)).append(')'); } return from.toString(); } private static <E extends Entity> String getSqlFromForCount(EntityMetaData entityMeta, List<Attribute> mrefAttrsInQuery) { StringBuilder from = new StringBuilder(" FROM ").append(getTableName(entityMeta)).append(" AS this"); Attribute idAttribute = entityMeta.getIdAttribute(); for (int i = 0; i < mrefAttrsInQuery.size(); i++) { // extra join so we can filter on the mrefs Attribute mrefAttr = mrefAttrsInQuery.get(i); from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(idAttribute)).append(')'); ======= AttributeMetaData mrefAttr = mrefAttrsInQuery.get(i); if (mrefAttr.isMappedBy()) { // query table of referenced entity from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(mrefAttr.getMappedBy())).append(')'); } else { // query junction table from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(idAttribute)).append(')'); } >>>>>>> Attribute mrefAttr = mrefAttrsInQuery.get(i); if (mrefAttr.isMappedBy()) { // query table of referenced entity from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(mrefAttr.getMappedBy())).append(')'); } else { // query junction table from.append(" LEFT JOIN ").append(getJunctionTableName(entityMeta, mrefAttr)).append(" AS ") .append(getFilterColumnName(mrefAttr, i + 1)).append(" ON (this.") .append(getColumnName(idAttribute)).append(" = ").append(getFilterColumnName(mrefAttr, i + 1)) .append('.').append(getColumnName(idAttribute)).append(')'); } <<<<<<< private static String getColumnName(Attribute attr) ======= static String getColumnName(AttributeMetaData attr) >>>>>>> static String getColumnName(Attribute attr) <<<<<<< Attribute attr = entityMeta.getAttribute(rule.getField()); if (attr != null && isMultipleReferenceType(attr)) ======= AttributeMetaData attr = entityMeta.getAttribute(rule.getField()); if (attr != null && isJunctionTableAttribute(attr)) >>>>>>> Attribute attr = entityMeta.getAttribute(rule.getField()); if (attr != null && isJunctionTableAttribute(attr))
<<<<<<< import org.molgenis.data.transaction.TransactionLogRepositoryDecorator; import org.molgenis.data.transaction.TransactionLogService; import org.molgenis.data.transaction.index.IndexTransactionLogRepositoryDecorator; import org.molgenis.data.transaction.index.IndexTransactionLogService; ======= >>>>>>> import org.molgenis.data.transaction.index.IndexTransactionLogRepositoryDecorator; import org.molgenis.data.transaction.index.IndexTransactionLogService; <<<<<<< private final TransactionLogService transactionLogService; private final IndexTransactionLogService indexTansactionLogService; ======= >>>>>>> private final IndexTransactionLogService indexTansactionLogService; <<<<<<< // 4. Transaction log decorator decoratedRepository = new TransactionLogRepositoryDecorator(decoratedRepository, transactionLogService); // 4. Index Transaction log decorator decoratedRepository = new IndexTransactionLogRepositoryDecorator(decoratedRepository, indexTansactionLogService); ======= >>>>>>> // 4. Index Transaction log decorator decoratedRepository = new IndexTransactionLogRepositoryDecorator(decoratedRepository, indexTansactionLogService);
<<<<<<< import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; ======= import org.molgenis.data.meta.EntityMetaData; >>>>>>> import org.molgenis.data.meta.EntityMetaData; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private EntityTypeFactory entityTypeFactory; private AttributeMetaDataFactory attrMetaFactory; ======= private EntityMetaDataFactory entityMetaFactory; private AttributeFactory attributeFactory; >>>>>>> private EntityTypeFactory entityTypeFactory; private AttributeFactory attributeFactory; <<<<<<< return new ExcelRepository(name, poiSheet, entityTypeFactory, attrMetaFactory, cellProcessors); ======= return new ExcelRepository(name, poiSheet, entityMetaFactory, attributeFactory, cellProcessors); >>>>>>> return new ExcelRepository(name, poiSheet, entityTypeFactory, attributeFactory, cellProcessors); <<<<<<< return new ExcelRepository(name, poiSheet, entityTypeFactory, attrMetaFactory, cellProcessors); ======= return new ExcelRepository(name, poiSheet, entityMetaFactory, attributeFactory, cellProcessors); >>>>>>> return new ExcelRepository(name, poiSheet, entityTypeFactory, attributeFactory, cellProcessors);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory) throws IOException ======= EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory) throws IOException >>>>>>> EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory) throws IOException <<<<<<< VcfAttributes vcfAttributes, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory) ======= VcfAttributes vcfAttributes, EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory) >>>>>>> VcfAttributes vcfAttributes, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory)
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; <<<<<<< Iterable<AttributeMetaData> attributes = filter(entityType.getAtomicAttributes(), attributeMetaData -> attributeNames.contains(attributeMetaData.getName())); ======= Iterable<Attribute> attributes = filter(entityMetaData.getAtomicAttributes(), attribute -> attributeNames.contains(attribute.getName())); >>>>>>> Iterable<Attribute> attributes = filter(entityType.getAtomicAttributes(), attribute -> attributeNames.contains(attribute.getName())); <<<<<<< Iterable<AttributeMetaData> attributes = filter(entityType.getAtomicAttributes(), attributeMetaData -> attributeNames.contains(attributeMetaData.getName())); ======= Iterable<Attribute> attributes = filter(entityMetaData.getAtomicAttributes(), attribute -> attributeNames.contains(attribute.getName())); >>>>>>> Iterable<Attribute> attributes = filter(entityType.getAtomicAttributes(), attribute -> attributeNames.contains(attribute.getName()));
<<<<<<< when(attribute.getNullableExpression()).thenReturn("nullableExpression"); ======= when(attribute.getValidationExpression()).thenReturn("expression"); >>>>>>> when(attribute.getNullableExpression()).thenReturn("nullableExpression"); when(attribute.getValidationExpression()).thenReturn("expression"); <<<<<<< verify(attributeCopy).setNullableExpression("nullableExpression"); ======= verify(attributeCopy).setValidationExpression("expression"); >>>>>>> verify(attributeCopy).setNullableExpression("nullableExpression"); verify(attributeCopy).setValidationExpression("expression");
<<<<<<< ======= import org.slf4j.Logger; >>>>>>> import org.slf4j.Logger; <<<<<<< given().header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON) .body(createTestUserBody.toJSONString()).when().post("api/v1/sys_sec_User").then(); ======= given().header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON) .body(createTestUserBody.toJSONString()).when().post("api/v1/sys_sec_User"); >>>>>>> given().header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON) .body(createTestUserBody.toJSONString()).when().post("api/v1/sys_sec_User"); <<<<<<< getLogger(RestTestUtils.class).error(e.getMessage()); ======= LOG.error(e.getMessage()); } String importJobURL = given().multiPart(file).param("file").param("action", "ADD_UPDATE_EXISTING") .header(X_MOLGENIS_TOKEN, adminToken).post("plugin/importwizard/importFile").then().extract() .asString(); // Remove the leading '/' character and leading and trailing '"' characters importJobURL = importJobURL.substring(2, importJobURL.length() - 1); LOG.info("############ " + importJobURL); String importStatus = "RUNNING"; while (importStatus.equals("RUNNING")) { importStatus = given().contentType(APPLICATION_JSON).header(X_MOLGENIS_TOKEN, adminToken).get(importJobURL) .then().extract().path("status").toString(); try { sleep(500L); } catch (InterruptedException e) { LOG.error(e.getMessage()); } LOG.info("Status: " + importStatus); >>>>>>> LOG.error(e.getMessage()); } String importJobURL = given().multiPart(file).param("file").param("action", "ADD_UPDATE_EXISTING") .header(X_MOLGENIS_TOKEN, adminToken).post("plugin/importwizard/importFile").then().extract() .asString(); // Remove the leading '/' character and leading and trailing '"' characters importJobURL = importJobURL.substring(2, importJobURL.length() - 1); LOG.info("############ " + importJobURL); String importStatus = "RUNNING"; while (importStatus.equals("RUNNING")) { importStatus = given().contentType(APPLICATION_JSON).header(X_MOLGENIS_TOKEN, adminToken).get(importJobURL) .then().extract().path("status").toString(); try { sleep(500L); } catch (InterruptedException e) { LOG.error(e.getMessage()); } LOG.info("Status: " + importStatus);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private AttributeMetaDataFactory attributeMetaDataFactory; private EntityTypeFactory entityTypeFactory; ======= private AttributeFactory attributeFactory; private EntityMetaDataFactory entityMetaDataFactory; >>>>>>> private AttributeFactory attributeFactory; private EntityTypeFactory entityTypeFactory; <<<<<<< AttributeMetaDataFactory attributeMetaDataFactory, EntityTypeFactory entityTypeFactory) ======= AttributeFactory attributeFactory, EntityMetaDataFactory entityMetaDataFactory) >>>>>>> AttributeFactory attributeFactory, EntityTypeFactory entityTypeFactory) <<<<<<< this.attributeMetaDataFactory = requireNonNull(attributeMetaDataFactory); this.entityTypeFactory = requireNonNull(entityTypeFactory); ======= this.attributeFactory = requireNonNull(attributeFactory); this.entityMetaDataFactory = requireNonNull(entityMetaDataFactory); >>>>>>> this.attributeFactory = requireNonNull(attributeFactory); this.entityTypeFactory = requireNonNull(entityTypeFactory); <<<<<<< fileStore, menuReaderService, cadd, exac, snpEff, gavin, vcfAttributes, vcfUtils, entityTypeFactory, attributeMetaDataFactory); ======= fileStore, menuReaderService, cadd, exac, snpEff, gavin, vcfAttributes, vcfUtils, entityMetaDataFactory, attributeFactory); >>>>>>> fileStore, menuReaderService, cadd, exac, snpEff, gavin, vcfAttributes, vcfUtils, entityTypeFactory, attributeFactory);
<<<<<<< ======= import org.molgenis.framework.server.MolgenisSettings; >>>>>>> <<<<<<< return AnnotatorInfo.create(Status.BETA, Type.PHENOTYPE_ASSOCIATION, NAME, "Clinical Genomics Database", ======= return AnnotatorInfo.create(Status.READY, Type.PHENOTYPE_ASSOCIATION, "CGD", "Clinical Genomics Database", >>>>>>> return AnnotatorInfo.create(Status.READY, Type.PHENOTYPE_ASSOCIATION, "CGD", "Clinical Genomics Database",
<<<<<<< if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { projectCache.evict(destProject); ProjectState ps = projectCache.get(destProject.getNameKey()); repoManager.setProjectDescription(destProject.getNameKey(), // ps.getProject().getDescription()); } ======= if (branchUpdate.getResult() == RefUpdate.Result.FAST_FORWARD) { tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } >>>>>>> if (branchUpdate.getResult() == RefUpdate.Result.FAST_FORWARD) { tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { projectCache.evict(destProject); ProjectState ps = projectCache.get(destProject.getNameKey()); repoManager.setProjectDescription(destProject.getNameKey(), // ps.getProject().getDescription()); }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< for (AttributeMetaData attribute : entityType.getAtomicAttributes()) ======= for (Attribute attribute : entityMetaData.getAtomicAttributes()) >>>>>>> for (Attribute attribute : entityType.getAtomicAttributes())
<<<<<<< import org.molgenis.data.i18n.I18nStringDecorator; import org.molgenis.data.i18n.Language; import org.molgenis.data.i18n.LanguageRepositoryDecorator; import org.molgenis.data.meta.AttributeMetaData; import org.molgenis.data.meta.AttributeMetaDataRepositoryDecorator; import org.molgenis.data.meta.EntityMetaData; import org.molgenis.data.meta.EntityMetaDataImpl; import org.molgenis.data.meta.EntityMetaDataRepositoryDecorator; import org.molgenis.data.meta.Package; import org.molgenis.data.meta.PackageRepositoryDecorator; import org.molgenis.data.meta.system.SystemEntityMetaDataRegistry; ======= import org.molgenis.data.elasticsearch.reindex.ReindexActionRegisterService; import org.molgenis.data.elasticsearch.reindex.ReindexActionRepositoryDecorator; >>>>>>> import org.molgenis.data.i18n.I18nStringDecorator; import org.molgenis.data.i18n.Language; import org.molgenis.data.i18n.LanguageRepositoryDecorator; import org.molgenis.data.meta.AttributeMetaData; import org.molgenis.data.meta.AttributeMetaDataRepositoryDecorator; import org.molgenis.data.meta.EntityMetaData; import org.molgenis.data.meta.EntityMetaDataImpl; import org.molgenis.data.meta.EntityMetaDataRepositoryDecorator; import org.molgenis.data.meta.Package; import org.molgenis.data.meta.PackageRepositoryDecorator; import org.molgenis.data.meta.system.SystemEntityMetaDataRegistry; <<<<<<< import org.molgenis.data.support.TypedRepositoryDecorator; import org.molgenis.data.support.UntypedRepositoryDecorator; ======= import org.molgenis.data.support.OwnedEntityMetaData; >>>>>>> import org.molgenis.data.support.TypedRepositoryDecorator; import org.molgenis.data.support.UntypedRepositoryDecorator; <<<<<<< ======= private final ReindexActionRegisterService indexTransactionLogService; >>>>>>> <<<<<<< @Autowired public MolgenisRepositoryDecoratorFactory(EntityManager entityManager, ======= public MolgenisRepositoryDecoratorFactory(EntityManager entityManager, >>>>>>> @Autowired public MolgenisRepositoryDecoratorFactory(EntityManager entityManager, <<<<<<< // 4. Transaction log decorator // decoratedRepository = new TransactionLogRepositoryDecorator(decoratedRepository, transactionLogService); ======= // 4. Index Transaction log decorator decoratedRepository = new ReindexActionRepositoryDecorator(decoratedRepository, indexTransactionLogService); >>>>>>> // 4. Index Transaction log decorator decoratedRepository = new ReindexActionRepositoryDecorator(decoratedRepository, indexTransactionLogService);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< tabixVcfRepository = new TabixVcfRepository(file, "TabixTest", vcfAttributes, entityTypeFactory, attributeMetaDataFactory); ======= tabixVcfRepository = new TabixVcfRepository(file, "TabixTest", vcfAttributes, entityMetaDataFactory, attributeFactory); >>>>>>> tabixVcfRepository = new TabixVcfRepository(file, "TabixTest", vcfAttributes, entityTypeFactory, attributeFactory); <<<<<<< for (AttributeMetaData attr : entity.getEntityType().getAtomicAttributes()) ======= for (Attribute attr : entity.getEntityMetaData().getAtomicAttributes()) >>>>>>> for (Attribute attr : entity.getEntityType().getAtomicAttributes()) <<<<<<< for (AttributeMetaData attr : entity.getEntityType().getAtomicAttributes()) ======= for (Attribute attr : entity.getEntityMetaData().getAtomicAttributes()) >>>>>>> for (Attribute attr : entity.getEntityType().getAtomicAttributes())
<<<<<<< import org.molgenis.data.RepositoryDecoratorFactory; import org.molgenis.data.importer.EmxImportService; import org.molgenis.data.importer.ImportService; import org.molgenis.data.importer.ImportServiceFactory; import org.molgenis.data.meta.AttributeMetaDataRepositoryDecoratorFactory; import org.molgenis.data.meta.EntityMetaDataRepositoryDecoratorFactory; ======= import org.molgenis.elasticsearch.ElasticSearchService; >>>>>>> import org.molgenis.data.RepositoryDecoratorFactory; import org.molgenis.data.importer.EmxImportService; import org.molgenis.data.importer.ImportService; import org.molgenis.data.importer.ImportServiceFactory; import org.molgenis.data.meta.AttributeMetaDataRepositoryDecoratorFactory; import org.molgenis.data.meta.EntityMetaDataRepositoryDecoratorFactory; <<<<<<< return new MysqlRepositoryCollection(dataSource, dataService, entityMetaDataRepository(), attributeMetaDataRepository(), repositoryDecoratorFactory, entityMetaDataRepositoryDecoratorFactory, attributeMetaDataRepositoryDecoratorFactory) ======= return new MysqlRepositoryCollection(dataSource, dataService, packageRepository(), entityMetaDataRepository(), attributeMetaDataRepository(), elasticSearchService) >>>>>>> return new MysqlRepositoryCollection(dataSource, dataService, packageRepository(), entityMetaDataRepository(), attributeMetaDataRepository(), repositoryDecoratorFactory, entityMetaDataRepositoryDecoratorFactory, attributeMetaDataRepositoryDecoratorFactory)
<<<<<<< private final List<CategoryAlgorithmGenerator> categoryAlgorithmGenerators; ======= private final AlgorithmTemplateService algorithmTemplateService; >>>>>>> private final List<CategoryAlgorithmGenerator> categoryAlgorithmGenerators; private final AlgorithmTemplateService algorithmTemplateService; <<<<<<< AttributeMetaData sourceAttribute = entry.getKey(); ======= AttributeMetaData source = entry.getKey(); // determine source unit Unit<? extends Quantity> sourceUnit = unitResolver.resolveUnit(source, sourceEntityMeta); >>>>>>> AttributeMetaData source = entry.getKey(); // determine source unit Unit<? extends Quantity> sourceUnit = unitResolver.resolveUnit(source, sourceEntityMeta);
<<<<<<< public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + "references"; public static final String UNIQUEREFERENCE = "references"; public ReferencesController() ======= public static final String ID = "references"; public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + ID; private static final String DEFAULT_KEY_APP_CONTACT = "<p>Paste the code</p>"; private static final String KEY_APP_CONTACT = "app.references"; private final MolgenisSettings molgenisSettings; @Autowired public ReferencesController(MolgenisSettings molgenisSettings) { super(URI); if (molgenisSettings == null) throw new IllegalArgumentException("molgenisSettings is null"); this.molgenisSettings = molgenisSettings; } @RequestMapping(method = RequestMethod.GET) public String init(Model model) >>>>>>> public static final String ID = "references"; public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + ID; public ReferencesController()
<<<<<<< grantRights(adminToken, TYPE_TEST_PERMISSION_ID, testUserId, "TypeTest"); grantRights(adminToken, TYPE_TEST_REF_PERMISSION_ID, testUserId, "TypeTestRef"); grantRights(adminToken, LOCATION_PERMISSION_ID, testUserId, "Location"); grantRights(adminToken, PERSONS_PERMISSION_ID, testUserId, "Person"); ======= this.testUserToken = RestTestUtils.login("test", "test"); this.testUserToken = RestTestUtils.login("test", "test"); >>>>>>> grantRights(adminToken, TYPE_TEST_PERMISSION_ID, testUserId, "TypeTest"); grantRights(adminToken, TYPE_TEST_REF_PERMISSION_ID, testUserId, "TypeTestRef"); grantRights(adminToken, LOCATION_PERMISSION_ID, testUserId, "Location"); grantRights(adminToken, PERSONS_PERMISSION_ID, testUserId, "Person"); <<<<<<< * Login with user name and password and return token on success * * @param userName the username to login with * @param password the password to use for login * @return the token returned from the login */ private String login(String userName, String password) { JSONObject loginBody = new JSONObject(); loginBody.put("username", userName); loginBody.put("password", password); String token = given().log().all().contentType(APPLICATION_JSON).body(loginBody.toJSONString()).when() .post(PATH + "login").then().log().all().extract().path("token"); LOG.info("Login token for user(" + userName + "): " + token); return token; } private void createTestUser(String adminToken) { JSONObject createTestUserBody = new JSONObject(); createTestUserBody.put("active", true); createTestUserBody.put("username", REST_TEST_USER); createTestUserBody.put("password_", REST_TEST_USER_PASSWORD); createTestUserBody.put("superuser", false); createTestUserBody.put("changePassword", false); createTestUserBody.put("Email", REST_TEST_USER + "@example.com"); int code = given().log().all().header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON) .body(createTestUserBody.toJSONString()).when().post(PATH + "sys_sec_User").then().log().all().extract() .statusCode(); LOG.info("Created test user code: " + Integer.toString(code)); } /** ======= >>>>>>>
<<<<<<< null, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), null, null, ImmutableList.of()); ======= null, ImmutableList.of(), ImmutableList.of(), EditorAttributeIdentifier.create("id", "label"), EditorAttributeIdentifier.create("id", "label"), ImmutableList.of()); >>>>>>> null, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), EditorAttributeIdentifier.create("id", "label"), EditorAttributeIdentifier.create("id", "label"), ImmutableList.of()); <<<<<<< return "{\"id\":\"id_1\",\"labelI18n\":{},\"descriptionI18n\":{},\"abstract0\":false,\"backend\":\"backend\",\"attributes\":[],\"referringAttributes\":[],\"tags\":[],\"lookupAttributes\":[]}"; ======= return "{\"id\":\"id_1\",\"labelI18n\":{},\"descriptionI18n\":{},\"abstract0\":false,\"backend\":\"backend\",\"attributes\":[],\"tags\":[],\"idAttribute\":{\"id\":\"id\",\"label\":\"label\"},\"labelAttribute\":{\"id\":\"id\",\"label\":\"label\"},\"lookupAttributes\":[]}"; >>>>>>> return "{\"id\":\"id_1\",\"labelI18n\":{},\"descriptionI18n\":{},\"abstract0\":false,\"backend\":\"backend\",\"attributes\":[],\"referringAttributes\":[],\"tags\":[],\"idAttribute\":{\"id\":\"id\",\"label\":\"label\"},\"labelAttribute\":{\"id\":\"id\",\"label\":\"label\"},\"lookupAttributes\":[]}";
<<<<<<< import org.molgenis.data.i18n.model.LanguageMetaData; import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeMetadata; ======= import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.EntityType; <<<<<<< import static org.molgenis.MolgenisFieldTypes.AttributeType.TEXT; import static org.molgenis.data.i18n.model.I18nStringMetaData.I18N_STRING; import static org.molgenis.data.i18n.model.LanguageMetaData.DEFAULT_LANGUAGE_CODE; import static org.molgenis.data.meta.model.AttributeMetaDataMetaData.*; import static org.molgenis.data.meta.model.EntityType.AttributeCopyMode.SHALLOW_COPY_ATTRS; import static org.molgenis.data.meta.model.EntityTypeMetadata.ENTITY_META_DATA; import static org.molgenis.security.core.runas.RunAsSystemProxy.runAsSystem; ======= >>>>>>> <<<<<<< private final DataService dataService; private final AttributeMetaDataFactory attrMetaFactory; private final EntityTypeMetadata entityTypeMeta; private final I18nStringMetaData i18nStringMeta; public LanguageRepositoryDecorator(Repository<Language> decorated, DataService dataService, AttributeMetaDataFactory attrMetaFactory, EntityTypeMetadata entityTypeMeta, I18nStringMetaData i18nStringMeta) ======= private final LanguageService languageService; public LanguageRepositoryDecorator(Repository<Language> decorated, LanguageService languageService) >>>>>>> private final LanguageService languageService; public LanguageRepositoryDecorator(Repository<Language> decorated, LanguageService languageService) <<<<<<< this.dataService = requireNonNull(dataService); this.attrMetaFactory = requireNonNull(attrMetaFactory); this.entityTypeMeta = requireNonNull(entityTypeMeta); this.i18nStringMeta = requireNonNull(i18nStringMeta); ======= this.languageService = requireNonNull(languageService); >>>>>>> this.languageService = requireNonNull(languageService); <<<<<<< String languageCode = language.getCode(); if (languageCode.equalsIgnoreCase(LanguageMetaData.DEFAULT_LANGUAGE_CODE)) { throw new MolgenisDataException( "It is not possible to delete '" + languageCode + "'. This is the default language."); } decorated.delete(language); // remove i18n attributes from i18n string meta data AttributeMetaData attrLanguageCode = i18nStringMeta.getAttribute(languageCode); EntityType i18nMeta = EntityType .newInstance(dataService.getEntityType(I18nStringMetaData.I18N_STRING), SHALLOW_COPY_ATTRS); i18nMeta.removeAttribute(attrLanguageCode); runAsSystem(() -> dataService.update(ENTITY_META_DATA, i18nMeta)); // hack: update in memory representation EntityType i18nMetaUpdated = dataService.getEntityType(I18N_STRING); i18nMetaUpdated.removeAttribute(attrLanguageCode); // remove i18n attributes from entity meta data AttributeMetaData entityLabel = entityTypeMeta.getAttribute(LABEL + '-' + languageCode); AttributeMetaData entityDescription = entityTypeMeta.getAttribute(DESCRIPTION + '-' + languageCode); EntityType entityType = EntityType .newInstance(dataService.getEntityType(ENTITY_META_DATA), SHALLOW_COPY_ATTRS); entityType.removeAttribute(entityLabel); entityType.removeAttribute(entityDescription); runAsSystem(() -> dataService.update(ENTITY_META_DATA, entityType)); // hack: update in memory representation EntityType entityTypeUpdated = dataService.getEntityType(ENTITY_META_DATA); entityTypeUpdated.removeAttribute(entityLabel); entityTypeUpdated.removeAttribute(entityDescription); // remove i18n attributes from attribute meta data EntityType attrMetaMeta = attrMetaFactory.getAttributeMetaDataMetaData(); AttributeMetaData attrLabel = attrMetaMeta.getAttribute(LABEL + '-' + languageCode); AttributeMetaData attrDescription = attrMetaMeta.getAttribute(DESCRIPTION + '-' + languageCode); EntityType attrMeta = EntityType .newInstance(dataService.getEntityType(ATTRIBUTE_META_DATA), SHALLOW_COPY_ATTRS); attrMeta.removeAttribute(attrLabel); attrMeta.removeAttribute(attrDescription); runAsSystem(() -> dataService.update(ENTITY_META_DATA, attrMeta)); // hack: update in memory representation EntityType attrMetaUpdated = dataService.getEntityType(ATTRIBUTE_META_DATA); attrMetaUpdated.removeAttribute(attrLabel); attrMetaUpdated.removeAttribute(attrDescription); ======= throw new MolgenisDataException( format("Deleting languages is not allowed")); >>>>>>> throw new MolgenisDataException(format("Deleting languages is not allowed")); <<<<<<< } /** * Add language to attributes * Create new label and description attributes for the added language * * @param languageCode */ private void addLanguageToAttributes(String languageCode) { // Add language attributes for attribute meta data AttributeMetaData attrLabel = attrMetaFactory.create().setName(LABEL + '-' + languageCode).setNillable(true) .setLabel("Label (" + languageCode + ')'); AttributeMetaData attrDescription = attrMetaFactory.create().setName(DESCRIPTION + '-' + languageCode) .setNillable(true).setLabel("Description (" + languageCode + ')'); dataService.add(ATTRIBUTE_META_DATA, Stream.of(attrLabel, attrDescription)); EntityType attrMeta = EntityType .newInstance(dataService.getEntityType(ATTRIBUTE_META_DATA), SHALLOW_COPY_ATTRS); attrMeta.addAttribute(attrLabel); attrMeta.addAttribute(attrDescription); runAsSystem(() -> dataService.update(ENTITY_META_DATA, attrMeta)); //FIXME Hack: metaData of system entities is not updated after update EntityType attrMetaUpdated = dataService.getEntityType(ATTRIBUTE_META_DATA); attrMetaUpdated.addAttribute(attrLabel); attrMetaUpdated.addAttribute(attrDescription); } /** * Add language to attributes * Create new label and description attributes for the added language * * @param languageCode */ private void addLanguageToEntities(String languageCode) { // Add language attributes for entity meta data AttributeMetaData entityLabel = attrMetaFactory.create() .setName(EntityTypeMetadata.LABEL + '-' + languageCode).setNillable(true) .setLabel("Label (" + languageCode + ')'); AttributeMetaData entityDescription = attrMetaFactory.create() .setName(EntityTypeMetadata.DESCRIPTION + '-' + languageCode).setNillable(true) .setLabel("Description (" + languageCode + ')'); dataService.add(ATTRIBUTE_META_DATA, Stream.of(entityLabel, entityDescription)); EntityType entityType = EntityType .newInstance(dataService.getEntityType(ENTITY_META_DATA), SHALLOW_COPY_ATTRS); entityType.addAttribute(entityLabel); entityType.addAttribute(entityDescription); runAsSystem(() -> dataService.update(ENTITY_META_DATA, entityType)); } /** * Add language I18N for attribute meta data * * @param languageCode */ private void addLanguageToI18N(String languageCode) { AttributeMetaData languageCodeAttr = attrMetaFactory.create().setName(languageCode).setNillable(true) .setDataType(TEXT); dataService.add(ATTRIBUTE_META_DATA, Stream.of(languageCodeAttr)); EntityType i18nMeta = EntityType .newInstance(dataService.getEntityType(I18N_STRING), SHALLOW_COPY_ATTRS); i18nMeta.addAttribute(languageCodeAttr); runAsSystem(() -> dataService.update(ENTITY_META_DATA, i18nMeta)); //FIXME Hack: metaData of system entities is not updated after update EntityType i18nMetaUpdated = dataService.getEntityType(I18N_STRING); i18nMetaUpdated.addAttribute(languageCodeAttr); ======= >>>>>>>
<<<<<<< import org.molgenis.data.*; import org.molgenis.data.meta.MetaDataService; ======= import org.molgenis.data.DataService; import org.molgenis.data.Entity; import org.molgenis.data.Fetch; import org.molgenis.data.Query; import org.molgenis.data.Repository; import org.molgenis.data.RepositoryCapability; import org.molgenis.data.meta.AttributeMetaData; import org.molgenis.data.meta.EntityMetaData; >>>>>>> import org.molgenis.data.*; import org.molgenis.data.meta.MetaDataService; import org.molgenis.data.meta.AttributeMetaData; import org.molgenis.data.meta.EntityMetaData;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private final EntityTypeFactory entityTypeFactory; private final AttributeMetaDataFactory attrMetaFactory; ======= private final EntityMetaDataFactory entityMetaFactory; private final AttributeFactory attrMetaFactory; >>>>>>> private final EntityTypeFactory entityTypeFactory; private final AttributeFactory attrMetaFactory; <<<<<<< public CsvRepository(String file, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory) ======= public CsvRepository(String file, EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory) >>>>>>> public CsvRepository(String file, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory) <<<<<<< public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory, ======= public CsvRepository(File file, EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory, >>>>>>> public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory, <<<<<<< public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory, ======= public CsvRepository(File file, EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory, >>>>>>> public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory, <<<<<<< public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory, ======= public CsvRepository(File file, EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory, >>>>>>> public CsvRepository(File file, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory, <<<<<<< AttributeMetaData attr = attrMetaFactory.create().setName(attrName).setDataType(STRING); entityType.addAttribute(attr); ======= Attribute attr = attrMetaFactory.create().setName(attrName).setDataType(STRING); entityMetaData.addAttribute(attr); >>>>>>> Attribute attr = attrMetaFactory.create().setName(attrName).setDataType(STRING); entityType.addAttribute(attr);
<<<<<<< public void getSqlCreateForeignKeyMappedBy() { EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getIdAttribute()).thenReturn(refIdAttr); Attribute refXrefAttr = when(mock(Attribute.class).getName()).thenReturn("xrefAttr").getMock(); when(refXrefAttr.getDataType()).thenReturn(XREF); when(refXrefAttr.isInversedBy()).thenReturn(true); when(refXrefAttr.getInversedBy()).thenReturn(attr); when(refXrefAttr.getRefEntity()).thenReturn(entityType); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(attr.isMappedBy()).thenReturn(true); when(attr.getMappedBy()).thenReturn(refXrefAttr); String expectedSql = "ALTER TABLE \"refEntity_xrefAttr\" ADD CONSTRAINT \"entity_attr_fkey\" FOREIGN KEY (\"refIdAttr\") REFERENCES \"refEntity\"(\"refIdAttr\") ON DELETE CASCADE"; assertEquals(PostgreSqlQueryGenerator.getSqlCreateForeignKey(entityType, attr), expectedSql); } @Test ======= >>>>>>> <<<<<<< public void getSqlCreateJunctionTableOneToManyBidi() { EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); when(refIdAttr.getDataType()).thenReturn(STRING); Attribute refXrefAttr = when(mock(Attribute.class).getName()).thenReturn("xrefAttr").getMock(); when(refXrefAttr.getDataType()).thenReturn(XREF); when(refXrefAttr.isInversedBy()).thenReturn(true); when(refXrefAttr.getInversedBy()).thenReturn(attr); when(refXrefAttr.getRefEntity()).thenReturn(entityType); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getIdAttribute()).thenReturn(refIdAttr); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); when(idAttr.getDataType()).thenReturn(STRING); when(entityType.getIdAttribute()).thenReturn(idAttr); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.isMappedBy()).thenReturn(true); when(attr.getMappedBy()).thenReturn(refXrefAttr); when(attr.getRefEntity()).thenReturn(refEntityMeta); String expectedSql = "CREATE TABLE \"refEntity_xrefAttr\" (\"order\" INT,\"refIdAttr\" character varying(255) NOT NULL, \"xrefAttr\" character varying(255) NOT NULL, FOREIGN KEY (\"xrefAttr\") REFERENCES \"entity\"(\"idAttr\") ON DELETE CASCADE, UNIQUE (\"refIdAttr\"), UNIQUE (\"order\",\"refIdAttr\"))"; assertEquals(PostgreSqlQueryGenerator.getSqlCreateJunctionTable(entityType, attr), expectedSql); } @Test ======= >>>>>>> <<<<<<< public void getJunctionTableSelectMappedBy() { Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getIdAttribute()).thenReturn(refIdAttr); Attribute refAttr = when(mock(Attribute.class).getName()).thenReturn("refAttr").getMock(); EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getDataType()).thenReturn(MREF); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.isMappedBy()).thenReturn(true); when(attr.getMappedBy()).thenReturn(refAttr); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(entityType.getIdAttribute()).thenReturn(idAttr); assertEquals(PostgreSqlQueryGenerator.getSqlJunctionTableSelect(entityType, attr, 3), "SELECT \"refAttr\", \"order\",\"refIdAttr\" FROM \"refEntity_refAttr\" WHERE \"refAttr\" in (?, ?, ?) ORDER BY \"refAttr\", \"order\""); } @Test ======= >>>>>>> <<<<<<< public void getSqlInsertJunctionMappedBy() { Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getIdAttribute()).thenReturn(refIdAttr); Attribute refAttr = when(mock(Attribute.class).getName()).thenReturn("refAttr").getMock(); EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.isMappedBy()).thenReturn(true); when(attr.getMappedBy()).thenReturn(refAttr); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(entityType.getIdAttribute()).thenReturn(idAttr); assertEquals(PostgreSqlQueryGenerator.getSqlInsertJunction(entityType, attr), "INSERT INTO \"refEntity_refAttr\" (\"order\",\"refIdAttr\",\"refAttr\") VALUES (?,?,?)"); } @Test ======= >>>>>>> <<<<<<< assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityType, q, parameters, true), "SELECT this.\"idAttr\", (SELECT \"attr\".\"attr\" FROM \"entity_attr\" AS \"attr\" WHERE this.\"idAttr\" = \"attr\".\"idAttr\") AS \"attr\" FROM \"entity\" AS this"); ======= assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityMeta, q, parameters, true), "SELECT this.\"idAttr\", this.\"attr\" FROM \"entity\" AS this"); >>>>>>> assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityType, q, parameters, true), "SELECT this.\"idAttr\", this.\"attr\" FROM \"entity\" AS this"); <<<<<<< Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); ======= AttributeMetaData refIdAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("refIdAttr").getMock(); when(refIdAttr.getDataType()).thenReturn(STRING); EntityMetaData refEntityMeta = when(mock(EntityMetaData.class).getName()).thenReturn("refEntity").getMock(); >>>>>>> Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); when(refIdAttr.getDataType()).thenReturn(STRING); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); <<<<<<< Attribute refAttr = when(mock(Attribute.class).getName()).thenReturn("refAttr").getMock(); ======= when(refEntityMeta.getAttribute("refIdAttr")).thenReturn(refIdAttr); AttributeMetaData refAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("refAttr").getMock(); >>>>>>> when(refEntityMeta.getAttribute("refIdAttr")).thenReturn(refIdAttr); AttributeMetaData refAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("refAttr").getMock(); <<<<<<< assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityType, q, parameters, true), "SELECT this.\"idAttr\", (SELECT array_agg(DISTINCT ARRAY[\"attr\".\"order\"::TEXT,\"attr\".\"refIdAttr\"::TEXT]) FROM \"refEntity_refAttr\" AS \"attr\" WHERE this.\"idAttr\" = \"attr\".\"refAttr\") AS \"attr\" FROM \"entity\" AS this"); ======= assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityMeta, q, parameters, true), "SELECT this.\"idAttr\", (SELECT array_agg(\"refIdAttr\" ORDER BY \"refIdAttr\" ASC) FROM \"refEntity\" WHERE this.\"idAttr\" = \"refEntity\".\"refAttr\") AS \"attr\" FROM \"entity\" AS this"); >>>>>>> assertEquals(PostgreSqlQueryGenerator.getSqlSelect(entityType, q, parameters, true), "SELECT this.\"idAttr\", (SELECT array_agg(\"refIdAttr\" ORDER BY \"refIdAttr\" ASC) FROM \"refEntity\" WHERE this.\"idAttr\" = \"refEntity\".\"refAttr\") AS \"attr\" FROM \"entity\" AS this"); <<<<<<< @Test public void getSqlAddColumnMappedBy() { EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getDataType()).thenReturn(ONE_TO_MANY); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getBackend()).thenReturn(POSTGRESQL); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(attr.isMappedBy()).thenReturn(true); Attribute mappedByAttr = when(mock(Attribute.class).getName()).thenReturn("mappedByAttr").getMock(); when(attr.getMappedBy()).thenReturn(mappedByAttr); assertEquals(PostgreSqlQueryGenerator.getSqlAddColumn(entityType, attr), "ALTER TABLE \"refEntity\" ADD \"mappedByAttr_order\" SERIAL"); } @Test public void getSqlAddColumnMappedByCrossRepositoryCollection() { EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getDataType()).thenReturn(ONE_TO_MANY); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getBackend()).thenReturn("notPostgreSQL"); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(attr.isMappedBy()).thenReturn(true); Attribute mappedByAttr = when(mock(Attribute.class).getName()).thenReturn("mappedByAttr").getMock(); when(attr.getMappedBy()).thenReturn(mappedByAttr); assertNull(PostgreSqlQueryGenerator.getSqlAddColumn(entityType, attr)); } ======= >>>>>>> <<<<<<< public void getSqlDropColumnOneToManyMappedBy() { EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); Attribute refAttr = when(mock(Attribute.class).getName()).thenReturn("refAttr").getMock(); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.getMappedBy()).thenReturn(refAttr); when(attr.getRefEntity()).thenReturn(refEntityMeta); when(refAttr.getDataType()).thenReturn(XREF); when(refAttr.getInversedBy()).thenReturn(attr); when(refAttr.getRefEntity()).thenReturn(entityType); assertEquals(PostgreSqlQueryGenerator.getSqlDropColumn(entityType, attr), "ALTER TABLE \"refEntity\" DROP COLUMN \"refAttr_order\""); } @Test ======= >>>>>>> <<<<<<< @Test public void getSqlCreateJunctionTableIndexMappedBy() { Attribute refIdAttr = when(mock(Attribute.class).getName()).thenReturn("refIdAttr").getMock(); EntityType refEntityMeta = when(mock(EntityType.class).getName()).thenReturn("refEntity").getMock(); when(refEntityMeta.getIdAttribute()).thenReturn(refIdAttr); Attribute refAttr = when(mock(Attribute.class).getName()).thenReturn("refAttr").getMock(); when(refAttr.getDataType()).thenReturn(XREF); EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getDataType()).thenReturn(ONE_TO_MANY); when(attr.isMappedBy()).thenReturn(true); when(attr.getMappedBy()).thenReturn(refAttr); when(attr.getRefEntity()).thenReturn(refEntityMeta); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("idAttr").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); assertEquals(PostgreSqlQueryGenerator.getSqlCreateJunctionTableIndex(entityType, attr), "CREATE INDEX \"refEntity_refAttr_refIdAttr_idx\" ON \"refEntity_refAttr\" (\"refIdAttr\")"); } ======= >>>>>>>
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private static AttributeMetaData INFO_ATTR; private static AttributeMetaData GTC_ATTR; private static AttributeMetaData AC_ATTR; private static AttributeMetaData AN_ATTR; private static AttributeMetaData PUTATIVE_IMPACT_ATTR; private static AttributeMetaData EFFECT_ATTR; private static AttributeMetaData GENES_ATTR; private EntityType annotatedEntityType; public EntityType metaDataCanAnnotate; public EntityType metaDataCantAnnotate; public EntityType geneMeta; EntityType effectMeta; EntityType vcfMeta; EntityType sampleEntityType; public AttributeMetaData attributeMetaDataChrom; public AttributeMetaData attributeMetaDataPos; public AttributeMetaData attributeMetaDataRef; public AttributeMetaData attributeMetaDataAlt; public AttributeMetaData attributeMetaDataCantAnnotateChrom; ======= private static Attribute INFO_ATTR; private static Attribute GTC_ATTR; private static Attribute AC_ATTR; private static Attribute AN_ATTR; private static Attribute PUTATIVE_IMPACT_ATTR; private static Attribute EFFECT_ATTR; private static Attribute GENES_ATTR; private EntityMetaData annotatedEntityMetadata; public EntityMetaData metaDataCanAnnotate; public EntityMetaData metaDataCantAnnotate; public EntityMetaData geneMeta; EntityMetaData effectMeta; EntityMetaData vcfMeta; EntityMetaData sampleEntityMeta; public Attribute attributeChrom; public Attribute attributePos; public Attribute attributeRef; public Attribute attributeAlt; public Attribute attributeCantAnnotateChrom; >>>>>>> private static Attribute INFO_ATTR; private static Attribute GTC_ATTR; private static Attribute AC_ATTR; private static Attribute AN_ATTR; private static Attribute PUTATIVE_IMPACT_ATTR; private static Attribute EFFECT_ATTR; private static Attribute GENES_ATTR; private EntityType annotatedEntityType; public EntityType metaDataCanAnnotate; public EntityType metaDataCantAnnotate; public EntityType geneMeta; EntityType effectMeta; EntityType vcfMeta; EntityType sampleEntityType; public Attribute attributeChrom; public Attribute attributePos; public Attribute attributeRef; public Attribute attributeAlt; public Attribute attributeCantAnnotateChrom; <<<<<<< annotatedEntityType = entityTypeFactory.create().setName("test"); metaDataCanAnnotate = entityTypeFactory.create().setName("test"); metaDataCantAnnotate = entityTypeFactory.create().setName("test"); geneMeta = entityTypeFactory.create().setName(GENES); effectMeta = entityTypeFactory.create().setName(EFFECT); vcfMeta = entityTypeFactory.create().setName("vcfMeta"); sampleEntityType = entityTypeFactory.create().setName("vcfSampleEntity"); attributeMetaDataChrom = attributeMetaDataFactory.create().setName(CHROM).setDataType(STRING); attributeMetaDataPos = attributeMetaDataFactory.create().setName(POS).setDataType(INT); attributeMetaDataRef = attributeMetaDataFactory.create().setName(REF).setDataType(STRING); attributeMetaDataAlt = attributeMetaDataFactory.create().setName(ALT).setDataType(STRING); attributeMetaDataCantAnnotateChrom = attributeMetaDataFactory.create().setName(CHROM).setDataType(LONG); ======= annotatedEntityMetadata = entityMetaDataFactory.create().setName("test"); metaDataCanAnnotate = entityMetaDataFactory.create().setName("test"); metaDataCantAnnotate = entityMetaDataFactory.create().setName("test"); geneMeta = entityMetaDataFactory.create().setName(GENES); effectMeta = entityMetaDataFactory.create().setName(EFFECT); vcfMeta = entityMetaDataFactory.create().setName("vcfMeta"); sampleEntityMeta = entityMetaDataFactory.create().setName("vcfSampleEntity"); attributeChrom = attributeFactory.create().setName(CHROM).setDataType(STRING); attributePos = attributeFactory.create().setName(POS).setDataType(INT); attributeRef = attributeFactory.create().setName(REF).setDataType(STRING); attributeAlt = attributeFactory.create().setName(ALT).setDataType(STRING); attributeCantAnnotateChrom = attributeFactory.create().setName(CHROM).setDataType(LONG); >>>>>>> annotatedEntityType = entityTypeFactory.create().setName("test"); metaDataCanAnnotate = entityTypeFactory.create().setName("test"); metaDataCantAnnotate = entityTypeFactory.create().setName("test"); geneMeta = entityTypeFactory.create().setName(GENES); effectMeta = entityTypeFactory.create().setName(EFFECT); vcfMeta = entityTypeFactory.create().setName("vcfMeta"); sampleEntityType = entityTypeFactory.create().setName("vcfSampleEntity"); attributeChrom = attributeFactory.create().setName(CHROM).setDataType(STRING); attributePos = attributeFactory.create().setName(POS).setDataType(INT); attributeRef = attributeFactory.create().setName(REF).setDataType(STRING); attributeAlt = attributeFactory.create().setName(ALT).setDataType(STRING); attributeCantAnnotateChrom = attributeFactory.create().setName(CHROM).setDataType(LONG); <<<<<<< INFO_ATTR.addAttributePart(attributeMetaDataFactory.create().setName("ANNO").setDataType(STRING)); annotatedEntityType.addAttribute(INFO_ATTR); ======= INFO_ATTR.addAttributePart(attributeFactory.create().setName("ANNO").setDataType(STRING)); annotatedEntityMetadata.addAttribute(INFO_ATTR); >>>>>>> INFO_ATTR.addAttributePart(attributeFactory.create().setName("ANNO").setDataType(STRING)); annotatedEntityType.addAttribute(INFO_ATTR); <<<<<<< AttributeMetaData sampleId = attributeMetaDataFactory.create().setName(sampleIdAttrName); sampleEntityType.addAttribute(sampleId); sampleEntityType.setIdAttribute(sampleId); sampleEntityType.addAttribute(attributeMetaDataFactory.create().setName(formatDpAttrName)); sampleEntityType.addAttribute(attributeMetaDataFactory.create().setName(formatEcAttrName)); sampleEntityType.addAttribute(attributeMetaDataFactory.create().setName(formatGtAttrName)); ======= Attribute sampleId = attributeFactory.create().setName(sampleIdAttrName); sampleEntityMeta.addAttribute(sampleId); sampleEntityMeta.setIdAttribute(sampleId); sampleEntityMeta.addAttribute(attributeFactory.create().setName(formatDpAttrName)); sampleEntityMeta.addAttribute(attributeFactory.create().setName(formatEcAttrName)); sampleEntityMeta.addAttribute(attributeFactory.create().setName(formatGtAttrName)); >>>>>>> Attribute sampleId = attributeFactory.create().setName(sampleIdAttrName); sampleEntityType.addAttribute(sampleId); sampleEntityType.setIdAttribute(sampleId); sampleEntityType.addAttribute(attributeFactory.create().setName(formatDpAttrName)); sampleEntityType.addAttribute(attributeFactory.create().setName(formatEcAttrName)); sampleEntityType.addAttribute(attributeFactory.create().setName(formatGtAttrName)); <<<<<<< attributeMetaDataFactory.create().setName(SAMPLES).setDataType(MREF).setRefEntity(sampleEntityType)); ======= attributeFactory.create().setName(SAMPLES).setDataType(MREF).setRefEntity(sampleEntityMeta)); >>>>>>> attributeFactory.create().setName(SAMPLES).setDataType(MREF).setRefEntity(sampleEntityType));
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< Iterable<AttributeMetaData> attrs = entity.getEntityType().getAtomicAttributes(); ======= Iterable<Attribute> attrs = entity.getEntityMetaData().getAtomicAttributes(); >>>>>>> Iterable<Attribute> attrs = entity.getEntityType().getAtomicAttributes();
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory;
<<<<<<< import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; ======= import static org.molgenis.data.index.meta.IndexPackage.PACKAGE_INDEX; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_ID; >>>>>>> import static org.molgenis.data.index.meta.IndexPackage.PACKAGE_INDEX; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID;
<<<<<<< this(ds, dataService, entityMetaDataRepository, attributeMetaDataRepository, null, null, null); ======= this(ds, dataService, packageRepository, entityMetaDataRepository, attributeMetaDataRepository, null); >>>>>>> this(ds, dataService, packageRepository, entityMetaDataRepository, attributeMetaDataRepository, null, null, null);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< EntityType entityType = when(mock(EntityType.class).getName()).thenReturn(entityName).getMock(); AttributeMetaData idAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("id").getMock(); AttributeMetaData lblAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("label").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); when(entityType.getLabelAttribute()).thenReturn(lblAttr); ======= EntityMetaData entityMeta = when(mock(EntityMetaData.class).getName()).thenReturn(entityName).getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); Attribute lblAttr = when(mock(Attribute.class).getName()).thenReturn("label").getMock(); when(entityMeta.getIdAttribute()).thenReturn(idAttr); when(entityMeta.getLabelAttribute()).thenReturn(lblAttr); >>>>>>> EntityType entityType = when(mock(EntityType.class).getName()).thenReturn(entityName).getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); Attribute lblAttr = when(mock(Attribute.class).getName()).thenReturn("label").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); when(entityType.getLabelAttribute()).thenReturn(lblAttr); <<<<<<< EntityType entityType = when(mock(EntityType.class).getName()).thenReturn(entityName).getMock(); AttributeMetaData idAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("id").getMock(); AttributeMetaData lblAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("label").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); when(entityType.getLabelAttribute()).thenReturn(lblAttr); ======= EntityMetaData entityMeta = when(mock(EntityMetaData.class).getName()).thenReturn(entityName).getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); Attribute lblAttr = when(mock(Attribute.class).getName()).thenReturn("label").getMock(); when(entityMeta.getIdAttribute()).thenReturn(idAttr); when(entityMeta.getLabelAttribute()).thenReturn(lblAttr); >>>>>>> EntityType entityType = when(mock(EntityType.class).getName()).thenReturn(entityName).getMock(); Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); Attribute lblAttr = when(mock(Attribute.class).getName()).thenReturn("label").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); when(entityType.getLabelAttribute()).thenReturn(lblAttr); <<<<<<< EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); AttributeMetaData labelAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("labelAttr").getMock(); ======= EntityMetaData entityMeta = when(mock(EntityMetaData.class).getName()).thenReturn("entity").getMock(); Attribute labelAttr = when(mock(Attribute.class).getName()).thenReturn("labelAttr").getMock(); >>>>>>> EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute labelAttr = when(mock(Attribute.class).getName()).thenReturn("labelAttr").getMock();
<<<<<<< import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; ======= import static org.molgenis.data.index.meta.IndexPackage.PACKAGE_INDEX; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_ID; >>>>>>> import static org.molgenis.data.index.meta.IndexPackage.PACKAGE_INDEX; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID;
<<<<<<< import org.molgenis.data.Fetch; ======= import org.molgenis.data.EntityListener; >>>>>>> import org.molgenis.data.EntityListener; import org.molgenis.data.Fetch;
<<<<<<< import org.molgenis.data.CrudRepositorySecurityDecorator; ======= import org.molgenis.data.CrudRepository; >>>>>>> import org.molgenis.data.CrudRepository; import org.molgenis.data.CrudRepositorySecurityDecorator; <<<<<<< import org.molgenis.data.validation.EntityAttributesValidator; import org.molgenis.data.validation.RepositoryValidationDecorator; ======= import org.molgenis.elasticsearch.ElasticSearchService; >>>>>>> import org.molgenis.data.validation.EntityAttributesValidator; import org.molgenis.data.validation.RepositoryValidationDecorator; import org.molgenis.elasticsearch.ElasticSearchService; <<<<<<< dataService.addRepository(new CrudRepositorySecurityDecorator(repository)); ======= dataService.addRepository(getSecuredAndOptionallyIndexedRepository(repository)); >>>>>>> dataService.addRepository(getSecuredAndOptionallyIndexedRepository(repository)); <<<<<<< return new CrudRepositorySecurityDecorator(new RepositoryValidationDecorator(repo, new EntityAttributesValidator())); ======= return getSecuredAndOptionallyIndexedRepository(repo); >>>>>>> return getSecuredAndOptionallyIndexedRepository(repo);
<<<<<<< public void testUpdateBooksValue(TestCaseType testCase) { OneToManyTestHarness.AuthorsAndBooks authorsAndBooks = importAuthorsAndBooks(testCase); String bookName = authorsAndBooks.getBookMetaData().getName(); String authorName = authorsAndBooks.getAuthorMetaData().getName(); Entity author1 = dataService.findOneById(authorName, AUTHOR_1); Entity author2 = dataService.findOneById(authorName, AUTHOR_2); Entity book1 = dataService.findOneById(bookName, BOOK_1); Entity book2 = dataService.findOneById(bookName, BOOK_2); author1.set(ATTR_BOOKS, newArrayList(book2)); // switch books author2.set(ATTR_BOOKS, newArrayList(book1)); dataService.update(authorName, Stream.of(author1, author2)); assertEquals(dataService.findOneById(bookName, BOOK_1).getEntity(ATTR_AUTHOR).getIdValue(), AUTHOR_2); assertEquals(dataService.findOneById(bookName, BOOK_2).getEntity(ATTR_AUTHOR).getIdValue(), AUTHOR_1); Entity updatedAuthor1 = dataService.findOneById(authorName, AUTHOR_1); assertEquals(StreamSupport.stream(updatedAuthor1.getEntities(ATTR_BOOKS).spliterator(), false) .map(Entity::getIdValue).collect(toSet()), newHashSet(BOOK_2)); Entity updatedAuthor2 = dataService.findOneById(authorName, AUTHOR_2); assertEquals(StreamSupport.stream(updatedAuthor2.getEntities(ATTR_BOOKS).spliterator(), false) .map(Entity::getIdValue).collect(toSet()), newHashSet(BOOK_1)); } @Test(singleThreaded = true, expectedExceptions = MolgenisDataException.class, dataProvider = "requiredTestCaseDataProvider") public void testRequiredSetChildrenNull(TestCaseType testCase) { List<Entity> persons = importPersons(testCase); Entity person = persons.get(0); person.set(ATTR_CHILDREN, null); dataService.update(persons.get(0).getEntityType().getName(), person); } @Test(singleThreaded = true, expectedExceptions = MolgenisDataException.class, dataProvider = "requiredTestCaseDataProvider") public void testRequiredSetParentNull(TestCaseType testCase) { List<Entity> persons = importPersons(testCase); Entity person = persons.get(0); person.set(ATTR_PARENT, null); dataService.update(persons.get(0).getEntityType().getName(), person); } @Test(singleThreaded = true, dataProvider = "allTestCaseDataProvider") ======= >>>>>>> <<<<<<< List<Entity> persons = importPersons(testCase); String personName = persons.get(0).getEntityType().getName(); ======= OneToManyTestHarness.AuthorsAndBooks authorsAndBooks = importAuthorsAndBooks(ASCENDING_ORDER); String bookName = authorsAndBooks.getBookMetaData().getName(); String authorName = authorsAndBooks.getAuthorMetaData().getName(); Entity book1 = dataService.findOneById(bookName, BOOK_1); Entity book2 = dataService.findOneById(bookName, BOOK_2); Entity author3 = dataService.findOneById(authorName, AUTHOR_3); book1.set(ATTR_AUTHOR, author3); book2.set(ATTR_AUTHOR, author3); dataService.update(bookName, Stream.of(book2, book1)); Entity updatedAuthor3 = dataService.findOneById(authorName, AUTHOR_3); assertEquals( StreamSupport.stream(updatedAuthor3.getEntities(ATTR_BOOKS).spliterator(), false).map(Entity::getIdValue) .collect(toList()), newArrayList(BOOK_1, BOOK_2, BOOK_3)); Entity updatedAuthor1 = dataService.findOneById(authorName, AUTHOR_1); Entity updatedAuthor2 = dataService.findOneById(authorName, AUTHOR_2); assertEquals(Iterables.size(updatedAuthor1.getEntities(bookName)), 0); assertEquals(Iterables.size(updatedAuthor2.getEntities(bookName)), 0); } @Test(singleThreaded = true) public void testUpdateAuthorOrderDescending() { OneToManyTestHarness.AuthorsAndBooks authorsAndBooks = importAuthorsAndBooks(DESCENDING_ORDER); String bookName = authorsAndBooks.getBookMetaData().getName(); String authorName = authorsAndBooks.getAuthorMetaData().getName(); Entity book2 = dataService.findOneById(bookName, BOOK_2); Entity book3 = dataService.findOneById(bookName, BOOK_3); Entity author1 = dataService.findOneById(authorName, AUTHOR_1); book2.set(ATTR_AUTHOR, author1); book3.set(ATTR_AUTHOR, author1); dataService.update(bookName, Stream.of(book2, book3)); Entity updatedAuthor1 = dataService.findOneById(authorName, AUTHOR_1); assertEquals( StreamSupport.stream(updatedAuthor1.getEntities(ATTR_BOOKS).spliterator(), false).map(Entity::getIdValue) .collect(toList()), newArrayList(BOOK_3, BOOK_2, BOOK_1)); Entity updatedAuthor2 = dataService.findOneById(authorName, AUTHOR_2); Entity updatedAuthor3 = dataService.findOneById(authorName, AUTHOR_3); assertEquals(Iterables.size(updatedAuthor2.getEntities(ATTR_BOOKS)), 0); assertEquals(Iterables.size(updatedAuthor3.getEntities(ATTR_BOOKS)), 0); } @Test(singleThreaded = true) public void testUpdateParentOrderAscending() { List<Entity> persons = importPersons(ASCENDING_ORDER); String personName = persons.get(0).getEntityMetaData().getName(); >>>>>>> OneToManyTestHarness.AuthorsAndBooks authorsAndBooks = importAuthorsAndBooks(ASCENDING_ORDER); String bookName = authorsAndBooks.getBookMetaData().getName(); String authorName = authorsAndBooks.getAuthorMetaData().getName(); Entity book1 = dataService.findOneById(bookName, BOOK_1); Entity book2 = dataService.findOneById(bookName, BOOK_2); Entity author3 = dataService.findOneById(authorName, AUTHOR_3); book1.set(ATTR_AUTHOR, author3); book2.set(ATTR_AUTHOR, author3); dataService.update(bookName, Stream.of(book2, book1)); Entity updatedAuthor3 = dataService.findOneById(authorName, AUTHOR_3); assertEquals( StreamSupport.stream(updatedAuthor3.getEntities(ATTR_BOOKS).spliterator(), false).map(Entity::getIdValue) .collect(toList()), newArrayList(BOOK_1, BOOK_2, BOOK_3)); Entity updatedAuthor1 = dataService.findOneById(authorName, AUTHOR_1); Entity updatedAuthor2 = dataService.findOneById(authorName, AUTHOR_2); assertEquals(Iterables.size(updatedAuthor1.getEntities(bookName)), 0); assertEquals(Iterables.size(updatedAuthor2.getEntities(bookName)), 0); } @Test(singleThreaded = true) public void testUpdateAuthorOrderDescending() { OneToManyTestHarness.AuthorsAndBooks authorsAndBooks = importAuthorsAndBooks(DESCENDING_ORDER); String bookName = authorsAndBooks.getBookMetaData().getName(); String authorName = authorsAndBooks.getAuthorMetaData().getName(); Entity book2 = dataService.findOneById(bookName, BOOK_2); Entity book3 = dataService.findOneById(bookName, BOOK_3); Entity author1 = dataService.findOneById(authorName, AUTHOR_1); book2.set(ATTR_AUTHOR, author1); book3.set(ATTR_AUTHOR, author1); dataService.update(bookName, Stream.of(book2, book3)); Entity updatedAuthor1 = dataService.findOneById(authorName, AUTHOR_1); assertEquals( StreamSupport.stream(updatedAuthor1.getEntities(ATTR_BOOKS).spliterator(), false).map(Entity::getIdValue) .collect(toList()), newArrayList(BOOK_3, BOOK_2, BOOK_1)); Entity updatedAuthor2 = dataService.findOneById(authorName, AUTHOR_2); Entity updatedAuthor3 = dataService.findOneById(authorName, AUTHOR_3); assertEquals(Iterables.size(updatedAuthor2.getEntities(ATTR_BOOKS)), 0); assertEquals(Iterables.size(updatedAuthor3.getEntities(ATTR_BOOKS)), 0); } @Test(singleThreaded = true) public void testUpdateParentOrderAscending() { List<Entity> persons = importPersons(ASCENDING_ORDER); String personName = persons.get(0).getEntityMetaData().getName();
<<<<<<< private EntityType entityType; private Entity mockEntity; ======= private EntityMetaData entityMetaData; private Entity entity1; private Entity entity2; >>>>>>> private EntityType entityType; private Entity entity1; private Entity entity2; <<<<<<< mockEntity = entityManager.create(entityType, NO_POPULATE); mockEntity.set("ID", entityID); mockEntity.set("ATTRIBUTE_1", "test_value_1"); ======= entity1 = new DynamicEntity(entityMetaData); entity1.set("ID", entityID1); entity1.set("ATTRIBUTE_1", "test_value_1"); entity2 = new DynamicEntity(entityMetaData); entity2.set("ID", entityID2); entity2.set("ATTRIBUTE_1", "test_value_2"); >>>>>>> entity1 = new DynamicEntity(entityType); entity1.set("ID", entityID1); entity1.set("ATTRIBUTE_1", "test_value_1"); entity2 = new DynamicEntity(entityType); entity2.set("ID", entityID2); entity2.set("ATTRIBUTE_1", "test_value_2"); <<<<<<< l1Cache.put(repository, mockEntity); Optional<Entity> actualEntity = l1Cache.get(repository, entityID, entityType); ======= l1Cache.put(repository, entity1); Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityMetaData); >>>>>>> l1Cache.put(repository, entity1); Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityType); <<<<<<< Optional<Entity> actualEntity = l1Cache.get(repository, entityID, entityType); ======= Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityMetaData); >>>>>>> Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityType); <<<<<<< l1Cache.put(repository, mockEntity); actualEntity = l1Cache.get(repository, entityID, entityType); assertEquals(actualEntity, of(mockEntity)); ======= l1Cache.put(repository, entity1); Entity result = l1Cache.get(repository, entityID1, entityMetaData).get(); assertTrue(EntityUtils.equals(result, entity1)); >>>>>>> l1Cache.put(repository, entity1); Entity result = l1Cache.get(repository, entityID1, entityType).get(); assertTrue(EntityUtils.equals(result, entity1)); <<<<<<< actualEntity = l1Cache.get(repository, entityID, entityType); ======= actualEntity = l1Cache.get(repository, entityID1, entityMetaData); >>>>>>> actualEntity = l1Cache.get(repository, entityID1, entityType); <<<<<<< l1Cache.putDeletion(create(mockEntity)); Optional<Entity> actualEntity = l1Cache.get(repository, entityID, entityType); ======= l1Cache.putDeletion(create(entity1)); Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityMetaData); >>>>>>> l1Cache.putDeletion(create(entity1)); Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityType); <<<<<<< Optional<Entity> actualEntity = l1Cache.get(repository, entityID, entityType); ======= Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityMetaData); >>>>>>> Optional<Entity> actualEntity = l1Cache.get(repository, entityID1, entityType);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< void addAttribute(EntityType entityType, AttributeMetaData attribute); ======= void addAttribute(EntityMetaData entityMeta, Attribute attribute); >>>>>>> void addAttribute(EntityType entityType, Attribute attribute); <<<<<<< void updateAttribute(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr); ======= void updateAttribute(EntityMetaData entityMetaData, Attribute attr, Attribute updatedAttr); >>>>>>> void updateAttribute(EntityType entityType, Attribute attr, Attribute updatedAttr); <<<<<<< void deleteAttribute(EntityType entityType, AttributeMetaData attr); ======= void deleteAttribute(EntityMetaData entityMeta, Attribute attr); >>>>>>> void deleteAttribute(EntityType entityType, Attribute attr);
<<<<<<< @Override public EntityMetaData getInputMetaData() { DefaultEntityMetaData metadata = new DefaultEntityMetaData(this.getClass().getName()); metadata.addAttributeMetaData(new DefaultAttributeMetaData(UNIPROT_ID, FieldTypeEnum.STRING)); return metadata; } @Override public Boolean canAnnotate(EntityMetaData inputMetaData) { boolean canAnnotate = true; Iterable<AttributeMetaData> inputAttributes = getInputMetaData().getAttributes(); for (AttributeMetaData attribute : inputAttributes) { if (inputMetaData.getAttribute(attribute.getName()) == null) canAnnotate = false; else if (!inputMetaData.getAttribute(attribute.getName()).getDataType().equals(attribute.getDataType())) { canAnnotate = false; } } return canAnnotate; } @Override public String getName() { return "EBI-CHeMBL"; } ======= >>>>>>>
<<<<<<< return given() .log().all() .contentType(APPLICATION_JSON).body(loginBody.toJSONString()).when().post("api/v1/login").then() .log().all() ======= return given().contentType(APPLICATION_JSON).body(loginBody.toJSONString()).when().post("api/v1/login").then() >>>>>>> return given() .log().all() .contentType(APPLICATION_JSON).body(loginBody.toJSONString()).when().post("api/v1/login").then() .log().all() <<<<<<< .body(body.toJSONString()).when().post("api/v1/" + entityName).then() //.log().all() .extract().path("items[0].id"); ======= .body(body.toJSONString()).when().post(path + entityName).then().extract().path("items[0].id"); >>>>>>> .body(body.toJSONString()).when().post("api/v1/" + entityName).then().extract().path("items[0].id"); <<<<<<< given() .log().all() .header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON).body(body.toJSONString()).when() .post("api/v1/" + "sys_sec_UserAuthority").then().log(); ======= given().header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON).body(body.toJSONString()).when() .post(path + "sys_sec_UserAuthority"); >>>>>>> given() .log().all() .header("x-molgenis-token", adminToken).contentType(APPLICATION_JSON).body(body.toJSONString()).when() .post("api/v1/" + "sys_sec_UserAuthority").then().log();
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private EntityType entityType; private AttributeMetaData labelAttr; private AttributeMetaData xrefAttr; private EntityType xrefEntityType; private EntityType selfRefEntityType; ======= private EntityMetaData entityMeta; private Attribute labelAttr; private Attribute xrefAttr; private EntityMetaData xrefEntityMeta; private EntityMetaData selfRefEntityMetaData; >>>>>>> private EntityType entityType; private Attribute labelAttr; private Attribute xrefAttr; private EntityType xrefEntityType; private EntityType selfRefEntityType; <<<<<<< entityType = entityTypeFactory.create().setName("entity") .addAttribute(attributeMetaDataFactory.create().setName(ID_ATTR_NAME), ROLE_ID) .addAttribute(attributeMetaDataFactory.create().setName(LABEL_ATTR_NAME), ROLE_LABEL); ======= entityMeta = entityMetaDataFactory.create().setName("entity") .addAttribute(attributeFactory.create().setName(ID_ATTR_NAME), ROLE_ID) .addAttribute(attributeFactory.create().setName(LABEL_ATTR_NAME), ROLE_LABEL); >>>>>>> entityType = entityTypeFactory.create().setName("entity") .addAttribute(attributeFactory.create().setName(ID_ATTR_NAME), ROLE_ID) .addAttribute(attributeFactory.create().setName(LABEL_ATTR_NAME), ROLE_LABEL); <<<<<<< xrefAttr = attributeMetaDataFactory.create().setName(XREF_ATTR_NAME).setDataType(XREF) .setRefEntity(xrefEntityType); entityType.addAttribute(xrefAttr); ======= xrefAttr = attributeFactory.create().setName(XREF_ATTR_NAME).setDataType(XREF) .setRefEntity(xrefEntityMeta); entityMeta.addAttribute(xrefAttr); >>>>>>> xrefAttr = attributeFactory.create().setName(XREF_ATTR_NAME).setDataType(XREF).setRefEntity(xrefEntityType); entityType.addAttribute(xrefAttr);
<<<<<<< import com.google.common.collect.Lists; import org.apache.xmlbeans.impl.piccolo.io.FileFormatException; ======= >>>>>>> import com.google.common.collect.Lists; <<<<<<< List<AttributeMetaData> infoFields, String checkAnnotatedBeforeValue) throws FileFormatException, ======= List<String> infoFields, String checkAnnotatedBeforeValue) throws MolgenisInvalidFormatException, >>>>>>> List<AttributeMetaData> infoFields, String checkAnnotatedBeforeValue) throws MolgenisInvalidFormatException,
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.*; <<<<<<< AttributeMetaData idAttr = attributeMetaDataFactory.create().setName("idAttribute").setAuto(true); EntityType emd = entityTypeFactory.create().setName("testEntity"); ======= Attribute idAttr = attributeFactory.create().setName("idAttribute").setAuto(true); EntityMetaData emd = entityMetaDataFactory.create().setName("testEntity"); >>>>>>> Attribute idAttr = attributeFactory.create().setName("idAttribute").setAuto(true); EntityType emd = entityTypeFactory.create().setName("testEntity");
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< Iterable<String> atomicAttributes = transform(entityType.getAtomicAttributes(), AttributeMetaData::getName); ======= Iterable<String> atomicAttributes = transform(entityMetaData.getAtomicAttributes(), Attribute::getName); >>>>>>> Iterable<String> atomicAttributes = transform(entityType.getAtomicAttributes(), Attribute::getName); <<<<<<< Iterable<String> compoundAttributes = transform( filter(entityType.getAttributes(), attributeMetaData -> attributeMetaData.getDataType() == COMPOUND), AttributeMetaData::getName); ======= Iterable<String> compoundAttributes = transform(filter(entityMetaData.getAttributes(), attribute -> attribute.getDataType() == COMPOUND), Attribute::getName); >>>>>>> Iterable<String> compoundAttributes = transform( filter(entityType.getAttributes(), attribute -> attribute.getDataType() == COMPOUND), Attribute::getName); <<<<<<< AttributeMetaData ownIdAttribute = entityType.getOwnIdAttribute(); AttributeMetaData otherOwnIdAttribute = otherEntityType.getOwnIdAttribute(); ======= Attribute ownIdAttribute = entityMeta.getOwnIdAttribute(); Attribute otherOwnIdAttribute = otherEntityMeta.getOwnIdAttribute(); >>>>>>> Attribute ownIdAttribute = entityType.getOwnIdAttribute(); Attribute otherOwnIdAttribute = otherEntityType.getOwnIdAttribute(); <<<<<<< AttributeMetaData ownLabelAttribute = entityType.getOwnLabelAttribute(); AttributeMetaData otherOwnLabelAttribute = otherEntityType.getOwnLabelAttribute(); ======= Attribute ownLabelAttribute = entityMeta.getOwnLabelAttribute(); Attribute otherOwnLabelAttribute = otherEntityMeta.getOwnLabelAttribute(); >>>>>>> Attribute ownLabelAttribute = entityType.getOwnLabelAttribute(); Attribute otherOwnLabelAttribute = otherEntityType.getOwnLabelAttribute(); <<<<<<< List<AttributeMetaData> lookupAttrs = newArrayList(entityType.getOwnLookupAttributes()); List<AttributeMetaData> otherLookupAttrs = newArrayList(otherEntityType.getOwnLookupAttributes()); ======= List<Attribute> lookupAttrs = newArrayList(entityMeta.getOwnLookupAttributes()); List<Attribute> otherLookupAttrs = newArrayList(otherEntityMeta.getOwnLookupAttributes()); >>>>>>> List<Attribute> lookupAttrs = newArrayList(entityType.getOwnLookupAttributes()); List<Attribute> otherLookupAttrs = newArrayList(otherEntityType.getOwnLookupAttributes()); <<<<<<< if (!entity.getEntityType().getName().equals(otherEntity.getEntityType().getName())) return false; for (AttributeMetaData attr : entity.getEntityType().getAtomicAttributes()) ======= if (!entity.getEntityMetaData().getName().equals(otherEntity.getEntityMetaData().getName())) return false; for (Attribute attr : entity.getEntityMetaData().getAtomicAttributes()) >>>>>>> if (!entity.getEntityType().getName().equals(otherEntity.getEntityType().getName())) return false; for (Attribute attr : entity.getEntityType().getAtomicAttributes()) <<<<<<< for (AttributeMetaData attr : entity.getEntityType().getAtomicAttributes()) ======= for (Attribute attr : entity.getEntityMetaData().getAtomicAttributes()) >>>>>>> for (Attribute attr : entity.getEntityType().getAtomicAttributes())
<<<<<<< modules.add( test ? new H2AccountPatchReviewStore.InMemoryModule() : new H2AccountPatchReviewStore.Module()); ======= modules.add(test ? new H2AccountPatchReviewStore.InMemoryModule() : new JdbcAccountPatchReviewStore.Module(config)); >>>>>>> modules.add( test ? new H2AccountPatchReviewStore.InMemoryModule() : new JdbcAccountPatchReviewStore.Module(config));
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< AttributeMetaData attr = getAttribute(entityType, attrName); createFetchContentRec(attrFilter, entityType, attr, fetch, languageCode); ======= Attribute attr = getAttribute(entityMeta, attrName); createFetchContentRec(attrFilter, entityMeta, attr, fetch, languageCode); >>>>>>> Attribute attr = getAttribute(entityType, attrName); createFetchContentRec(attrFilter, entityType, attr, fetch, languageCode); <<<<<<< private static void createFetchContentRec(AttributeFilter attrFilter, EntityType entityType, AttributeMetaData attr, Fetch fetch, String languageCode) ======= private static void createFetchContentRec(AttributeFilter attrFilter, EntityMetaData entityMeta, Attribute attr, Fetch fetch, String languageCode) >>>>>>> private static void createFetchContentRec(AttributeFilter attrFilter, EntityType entityType, Attribute attr, Fetch fetch, String languageCode) <<<<<<< AttributeMetaData attrPart = attr.getAttributePart(attrPartName); createFetchContentRec(subAttrFilter, entityType, attrPart, fetch, languageCode); ======= Attribute attrPart = attr.getAttributePart(attrPartName); createFetchContentRec(subAttrFilter, entityMeta, attrPart, fetch, languageCode); >>>>>>> Attribute attrPart = attr.getAttributePart(attrPartName); createFetchContentRec(subAttrFilter, entityType, attrPart, fetch, languageCode);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< emd = entityTypeFactory.create().setName("resourceName"); AttributeMetaData attr = attributeMetaDataFactory.create().setName("id"); ======= emd = entityMetaDataFactory.create().setName("resourceName"); Attribute attr = attributeFactory.create().setName("id"); >>>>>>> emd = entityTypeFactory.create().setName("resourceName"); Attribute attr = attributeFactory.create().setName("id");
<<<<<<< import org.molgenis.data.i18n.model.LanguageMetaData; import org.molgenis.data.index.IndexActionRegisterService; import org.molgenis.data.index.IndexActionRegisterServiceImpl; import org.molgenis.data.index.meta.IndexActionMetaData; ======= import org.molgenis.data.i18n.model.LanguageMetadata; >>>>>>> import org.molgenis.data.index.IndexActionRegisterService; import org.molgenis.data.index.IndexActionRegisterServiceImpl; import org.molgenis.data.index.meta.IndexActionMetaData; import org.molgenis.data.i18n.model.LanguageMetadata;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttributeMetaData; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttribute; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttribute; <<<<<<< public String generate(AttributeMetaData targetAttribute, List<AttributeMetaData> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) ======= public String generate(Attribute targetAttribute, List<Attribute> sourceAttributes, EntityMetaData targetEntityMetaData, EntityMetaData sourceEntityMetaData) >>>>>>> public String generate(Attribute targetAttribute, List<Attribute> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) <<<<<<< String generateMixedTypes(AttributeMetaData targetAttribute, List<AttributeMetaData> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) ======= String generateMixedTypes(Attribute targetAttribute, List<Attribute> sourceAttributes, EntityMetaData targetEntityMetaData, EntityMetaData sourceEntityMetaData) >>>>>>> String generateMixedTypes(Attribute targetAttribute, List<Attribute> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) <<<<<<< public GeneratedAlgorithm generate(AttributeMetaData targetAttribute, Map<AttributeMetaData, ExplainedAttributeMetaData> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) ======= public GeneratedAlgorithm generate(Attribute targetAttribute, Map<Attribute, ExplainedAttribute> sourceAttributes, EntityMetaData targetEntityMetaData, EntityMetaData sourceEntityMetaData) >>>>>>> public GeneratedAlgorithm generate(Attribute targetAttribute, Map<Attribute, ExplainedAttribute> sourceAttributes, EntityType targetEntityType, EntityType sourceEntityType) <<<<<<< String convertUnitForTemplateAlgorithm(String algorithm, AttributeMetaData targetAttribute, EntityType targetEntityType, Set<AttributeMetaData> sourceAttributes, EntityType sourceEntityType) ======= String convertUnitForTemplateAlgorithm(String algorithm, Attribute targetAttribute, EntityMetaData targetEntityMetaData, Set<Attribute> sourceAttributes, EntityMetaData sourceEntityMetaData) >>>>>>> String convertUnitForTemplateAlgorithm(String algorithm, Attribute targetAttribute, EntityType targetEntityType, Set<Attribute> sourceAttributes, EntityType sourceEntityType)
<<<<<<< { EmbeddedElasticSearchConfig.class, ElasticsearchEntityFactory.class, ElasticsearchRepositoryCollection.class, RunAsSystemBeanPostProcessor.class, FileMetaMetaData.class, OwnedEntityMetaData.class, RhinoConfig.class, ExpressionValidator.class, LanguageService.class }) ======= {TransactionConfig.class, RunAsSystemBeanPostProcessor.class, FileMetaMetaData.class, OwnedEntityMetaData.class, RhinoConfig.class, ExpressionValidator.class, LanguageService.class, DatabaseConfig.class, UuidGenerator.class }) >>>>>>> { EmbeddedElasticSearchConfig.class, ElasticsearchEntityFactory.class, ElasticsearchRepositoryCollection.class, RunAsSystemBeanPostProcessor.class, FileMetaMetaData.class, OwnedEntityMetaData.class, RhinoConfig.class, ExpressionValidator.class, LanguageService.class }) <<<<<<< protected SearchService searchService; @Autowired ======= private TransactionLogService transactionLogService; @Autowired >>>>>>> protected SearchService searchService; @Autowired <<<<<<< return new MolgenisRepositoryDecoratorFactory(entityManager(), entityAttributesValidator(), idGenerator(), appSettings(), dataService(), expressionValidator, repositoryDecoratorRegistry()) .createDecoratedRepository(repository); ======= return new MolgenisRepositoryDecoratorFactory(entityManager(), transactionLogService, entityAttributesValidator(), idGenerator, appSettings(), dataService(), expressionValidator, repositoryDecoratorRegistry()).createDecoratedRepository(repository); >>>>>>> return new MolgenisRepositoryDecoratorFactory(entityManager(), entityAttributesValidator(), idGenerator, appSettings(), dataService(), expressionValidator, repositoryDecoratorRegistry()) .createDecoratedRepository(repository);
<<<<<<< import org.molgenis.data.UnknownEntityException; ======= import org.molgenis.data.Query; import org.molgenis.data.UnknownEntityException; >>>>>>> import org.molgenis.data.UnknownEntityException; import org.molgenis.data.Query; import org.molgenis.data.UnknownEntityException; <<<<<<< import org.molgenis.data.security.exception.*; import org.molgenis.data.security.permission.RoleMembershipService; import org.molgenis.data.security.user.UserService; ======= import org.molgenis.data.support.QueryImpl; >>>>>>> import org.molgenis.data.security.exception.*; import org.molgenis.data.security.permission.RoleMembershipService; import org.molgenis.data.security.user.UserService; import org.molgenis.data.support.QueryImpl; <<<<<<< private final GroupMetadata groupMetadata; private final RoleMembershipService roleMembershipService; private final UserService userService; ======= private final RoleMetadata roleMetadata; >>>>>>> private final GroupMetadata groupMetadata; private final RoleMembershipService roleMembershipService; private final UserService userService; private final RoleMetadata roleMetadata; <<<<<<< DataService dataService, PermissionService permissionService, GroupMetadata groupMetadata, RoleMembershipService roleMembershipService, UserService userService) ======= DataService dataService, PermissionService permissionService, RoleMetadata roleMetadata) >>>>>>> DataService dataService, PermissionService permissionService, GroupMetadata groupMetadata, RoleMembershipService roleMembershipService, UserService userService) DataService dataService, PermissionService permissionService, RoleMetadata roleMetadata) <<<<<<< this.groupMetadata = requireNonNull(groupMetadata); this.roleMembershipService = requireNonNull(roleMembershipService); this.userService = requireNonNull(userService); ======= this.roleMetadata = requireNonNull(roleMetadata); >>>>>>> this.groupMetadata = requireNonNull(groupMetadata); this.roleMembershipService = requireNonNull(roleMembershipService); this.userService = requireNonNull(userService); this.roleMetadata = requireNonNull(roleMetadata);
<<<<<<< import org.molgenis.omx.harmonization.config.HarmonizationConfig; ======= import org.molgenis.omx.config.DataExplorerConfig; >>>>>>> import org.molgenis.omx.config.DataExplorerConfig; import org.molgenis.omx.harmonization.config.HarmonizationConfig;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); AttributeMetaData labelAttr = entityType.getLabelAttribute(); ======= Attribute idAttr = entityMetaData.getIdAttribute(); Attribute labelAttr = entityMetaData.getLabelAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); Attribute labelAttr = entityType.getLabelAttribute(); <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMetaData.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMetaData.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMetaData.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute();
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< HpoResultFilter filter = new HpoResultFilter(entityTypeFactory, attributeMetaDataFactory, hpoAnnotator); ======= HpoResultFilter filter = new HpoResultFilter(entityMetaDataFactory, attributeFactory, hpoAnnotator); >>>>>>> HpoResultFilter filter = new HpoResultFilter(entityTypeFactory, attributeFactory, hpoAnnotator); <<<<<<< EntityType entityType = entityTypeFactory.create().setSimpleName("HPO"); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityType.addAttribute(attributeMetaDataFactory.create().setName(HPO_TERM_COL_NAME)); ======= EntityMetaData entityMeta = entityMetaDataFactory.create().setSimpleName("HPO"); entityMeta.addAttribute(attributeFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityMeta.addAttribute(attributeFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityMeta.addAttribute(attributeFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityMeta.addAttribute(attributeFactory.create().setName(HPO_TERM_COL_NAME)); >>>>>>> EntityType entityType = entityTypeFactory.create().setSimpleName("HPO"); entityType.addAttribute(attributeFactory.create().setName(HPO_DISEASE_ID_COL_NAME)); entityType.addAttribute(attributeFactory.create().setName(HPO_GENE_SYMBOL_COL_NAME)); entityType.addAttribute(attributeFactory.create().setName(HPO_ID_COL_NAME), ROLE_ID); entityType.addAttribute(attributeFactory.create().setName(HPO_TERM_COL_NAME));
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< public AttributeMetaDataResponse retrieveEntityAttributeMetaPost(@PathVariable("entityName") String entityName, @PathVariable("attributeName") String attributeName, @Valid @RequestBody EntityTypeRequest request) ======= public AttributeResponse retrieveEntityAttributeMetaPost(@PathVariable("entityName") String entityName, @PathVariable("attributeName") String attributeName, @Valid @RequestBody EntityMetaRequest request) >>>>>>> public AttributeResponse retrieveEntityAttributeMetaPost(@PathVariable("entityName") String entityName, @PathVariable("attributeName") String attributeName, @Valid @RequestBody EntityTypeRequest request) <<<<<<< AttributeMetaData attr = entityType.getAttribute(attributeName); ======= Attribute attr = entityMetaData.getAttribute(attributeName); >>>>>>> Attribute attr = entityType.getAttribute(attributeName); <<<<<<< AttributeMetaData attribute = entityType.getAttribute(queryRule.getField()); ======= Attribute attribute = entityMetaData.getAttribute(queryRule.getField()); >>>>>>> Attribute attribute = entityType.getAttribute(queryRule.getField()); <<<<<<< EntityType meta = dataService.getEntityType(entityName); AttributeMetaData attributeMetaData = meta.getAttribute(attributeName); if (attributeMetaData != null) ======= EntityMetaData meta = dataService.getEntityMetaData(entityName); Attribute attribute = meta.getAttribute(attributeName); if (attribute != null) >>>>>>> EntityType meta = dataService.getEntityType(entityName); Attribute attribute = meta.getAttribute(attributeName); if (attribute != null)
<<<<<<< this.i18nStrings = new LinkedHashMap<>(); ======= this.l10nStrings = new LinkedHashMap<>(); this.entityTypeFactory = entityTypeFactory; >>>>>>> this.l10nStrings = new LinkedHashMap<>();
<<<<<<< @Transactional public Integer add(Stream<Entity> entities) ======= public Integer add(Stream<? extends Entity> entities) >>>>>>> public Integer add(Stream<Entity> entities) <<<<<<< @Transactional public void update(Stream<Entity> entities) ======= public void update(Stream<? extends Entity> entities) >>>>>>> public void update(Stream<Entity> entities) <<<<<<< @Transactional public void delete(Stream<Entity> entities) ======= public void delete(Stream<? extends Entity> entities) >>>>>>> public void delete(Stream<Entity> entities)
<<<<<<< import org.molgenis.data.meta.SystemEntityType; import org.molgenis.data.meta.model.Attribute; ======= import org.molgenis.data.Sort; import org.molgenis.data.meta.SystemEntityMetaData; import org.molgenis.data.meta.model.AttributeMetaData; >>>>>>> import org.molgenis.data.Sort; import org.molgenis.data.meta.SystemEntityType; import org.molgenis.data.meta.model.Attribute; <<<<<<< import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_LABEL; ======= import static org.molgenis.data.Sort.Direction.ASC; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_LABEL; >>>>>>> import static org.molgenis.data.Sort.Direction.ASC; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_LABEL; <<<<<<< Attribute parentAttr = addAttribute(ATTR_PARENT).setDataType(XREF).setRefEntity(this).setNillable(true); ======= AttributeMetaData parentAttr = addAttribute(ATTR_PARENT).setDataType(XREF).setRefEntity(this); >>>>>>> Attribute parentAttr = addAttribute(ATTR_PARENT).setDataType(XREF).setRefEntity(this);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< AttributeMetaData idAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("id").getMock(); entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr); ======= Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); entityMetaData = when(mock(EntityMetaData.class).getName()).thenReturn("entity").getMock(); when(entityMetaData.getIdAttribute()).thenReturn(idAttr); >>>>>>> Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock(); entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttr);
<<<<<<< entity.set(NODE_PATH, termPath + "[" + (termPath.split("\\.").length - 1) + "]"); ======= entity.set(ID, loader.getId(cls)); entity.set(NODE_PATH, termPath); >>>>>>> entity.set(ID, loader.getId(cls)); entity.set(NODE_PATH, termPath + "[" + (termPath.split("\\.").length - 1) + "]");
<<<<<<< ======= import org.molgenis.data.Entity; import org.molgenis.file.FileStore; >>>>>>> import org.molgenis.file.FileStore; <<<<<<< import org.molgenis.ontology.core.service.OntologyService; import org.molgenis.util.FileStore; ======= import org.molgenis.ontology.matching.OntologyService; import org.molgenis.ontology.utils.OntologyServiceUtil; >>>>>>> import org.molgenis.ontology.core.service.OntologyService;
<<<<<<< import static org.testng.Assert.assertEquals; ======= >>>>>>> import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertEquals; <<<<<<< @Autowired private SecureIdGenerator secureIdGenerator; @BeforeClass public void beforeClass() { initMocks(this); when(appSettings.getTitle()).thenReturn("Molgenis title"); } ======= @Autowired private IdGenerator idGenerator; >>>>>>> @Autowired private IdGenerator idGenerator; @BeforeClass public void beforeClass() { initMocks(this); when(appSettings.getTitle()).thenReturn("Molgenis title"); } <<<<<<< reset(dataService, mailSender); ======= reset(dataService, idGenerator); >>>>>>> reset(dataService, idGenerator, mailSender); <<<<<<< when(secureIdGenerator.generatePassword()).thenReturn("3541db68"); ======= User user = mock(User.class); when(user.getPassword()).thenReturn("password"); when(idGenerator.generateId(SHORT_SECURE_RANDOM)).thenReturn("newPassword"); >>>>>>> User user = mock(User.class); when(user.getPassword()).thenReturn("password"); when(idGenerator.generateId(SHORT_SECURE_RANDOM)).thenReturn("3541db68"); <<<<<<< ArgumentCaptor<User> argument = ArgumentCaptor.forClass(User.class); verify(dataService).update(eq(USER), argument.capture()); assertEquals(argument.getValue().getPassword(), "3541db68"); SimpleMailMessage expected = new SimpleMailMessage(); expected.setTo("[email protected]"); expected.setSubject("Your new password request"); expected.setText("Somebody, probably you, requested a new password for Molgenis title.\n" + "The new password is: 3541db68\n" + "Note: we strongly recommend you reset your password after log-in!"); verify(mailSender).send(expected); ======= verify(dataService).update(USER, user); verify(user).setPassword("newPassword"); verify(javaMailSender).send(any(SimpleMailMessage.class)); >>>>>>> verify(dataService).update(USER, user); verify(user).setPassword("newPassword"); verify(javaMailSender).send(any(SimpleMailMessage.class)); SimpleMailMessage expected = new SimpleMailMessage(); expected.setTo("[email protected]"); expected.setSubject("Your new password request"); expected.setText("Somebody, probably you, requested a new password for Molgenis title.\n" + "The new password is: 3541db68\n" + "Note: we strongly recommend you reset your password after log-in!"); verify(mailSender).send(expected); <<<<<<< secureIdGenerator(), molgenisGroupMemberFactory()); ======= molgenisGroupMemberFactory(), idGenerator()); } @Bean public IdGenerator idGenerator() { return mock(IdGenerator.class); >>>>>>> molgenisGroupMemberFactory(), idGenerator()); } @Bean public IdGenerator idGenerator() { return mock(IdGenerator.class);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< exac, snpeff, gavin, vcfAttributes, vcfUtils, entityTypeFactory, attributeMetaDataFactory); ======= exac, snpeff, gavin, vcfAttributes, vcfUtils, entityMetaDataFactory, attributeFactory); >>>>>>> exac, snpeff, gavin, vcfAttributes, vcfUtils, entityTypeFactory, attributeFactory);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< repo = new OmimRepository(omimFile, entityTypeFactory, attributeMetaDataFactory); ======= repo = new OmimRepository(omimFile, entityMetaDataFactory, attributeFactory); >>>>>>> repo = new OmimRepository(omimFile, entityTypeFactory, attributeFactory);
<<<<<<< @Test public void updateListextendsEntityDatabaseActionString() { String keyName = "key"; DatabaseAction dbAction = DatabaseAction.UPDATE_IGNORE_MISSING; List<? extends Entity> entities = Arrays.asList(mock(Entity.class), mock(Entity.class)); elasticSearchRepository.update(entities, dbAction, keyName); verify(repository).update(entities, dbAction, keyName); verify(elasticSearchService).index(Matchers.<Iterable<Entity>> any(), eq(repositoryEntityMetaData), eq(IndexingMode.UPDATE)); } @Test public void rebuildIndex() { elasticSearchRepository.rebuildIndex(); verify(elasticSearchService).indexRepository(repository); } ======= >>>>>>> @Test public void rebuildIndex() { elasticSearchRepository.rebuildIndex(); verify(elasticSearchService).indexRepository(repository); }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< public void addAttribute(EntityType entityType, AttributeMetaData attribute) ======= public void addAttribute(EntityMetaData entityMeta, Attribute attribute) >>>>>>> public void addAttribute(EntityType entityType, Attribute attribute) <<<<<<< public void updateAttribute(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= public void updateAttribute(EntityMetaData entityMetaData, Attribute attr, Attribute updatedAttr) >>>>>>> public void updateAttribute(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< public void deleteAttribute(EntityType entityType, AttributeMetaData attr) ======= public void deleteAttribute(EntityMetaData entityMeta, Attribute attr) >>>>>>> public void deleteAttribute(EntityType entityType, Attribute attr)
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); AttributeMetaData intAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("int").getMock(); ======= EntityMetaData entityMetaData = when(mock(EntityMetaData.class).getName()).thenReturn("entity").getMock(); Attribute intAttr = when(mock(Attribute.class).getName()).thenReturn("int").getMock(); >>>>>>> EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("entity").getMock(); Attribute intAttr = when(mock(Attribute.class).getName()).thenReturn("int").getMock(); <<<<<<< when(entityType.getAttribute("int")).thenReturn(intAttr); AttributeMetaData stringAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("string").getMock(); ======= when(entityMetaData.getAttribute("int")).thenReturn(intAttr); Attribute stringAttr = when(mock(Attribute.class).getName()).thenReturn("string").getMock(); >>>>>>> when(entityType.getAttribute("int")).thenReturn(intAttr); Attribute stringAttr = when(mock(Attribute.class).getName()).thenReturn("string").getMock();
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< return stream(entityType.getAtomicAttributes().spliterator(), false).map(AttributeMetaData::getName)::iterator; ======= return stream(entityMeta.getAtomicAttributes().spliterator(), false).map(Attribute::getName)::iterator; >>>>>>> return stream(entityType.getAtomicAttributes().spliterator(), false).map(Attribute::getName)::iterator; <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< AttributeMetaData labelAttr = entityType.getLabelAttribute(); ======= Attribute labelAttr = entityMeta.getLabelAttribute(); >>>>>>> Attribute labelAttr = entityType.getLabelAttribute(); <<<<<<< AttributeMetaData attr = entityType.getAttribute(attrName); ======= Attribute attr = entityMeta.getAttribute(attrName); >>>>>>> Attribute attr = entityType.getAttribute(attrName);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< private final EntityTypeFactory entityTypeFactory; private final AttributeMetaDataFactory attrMetaFactory; ======= private final EntityMetaDataFactory entityMetaFactory; private final AttributeFactory attrMetaFactory; >>>>>>> private final EntityTypeFactory entityTypeFactory; private final AttributeFactory attrMetaFactory; <<<<<<< EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory) ======= EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory) >>>>>>> EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory) throws IOException, ServiceException { this(spreadsheetService, spreadsheetKey, worksheetId, entityTypeFactory, attrMetaFactory, Visibility.PUBLIC); } public GoogleSpreadsheetRepository(SpreadsheetService spreadsheetService, String spreadsheetKey, String worksheetId, EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory, Visibility visibility) <<<<<<< EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attrMetaFactory, Visibility visibility) ======= EntityMetaDataFactory entityMetaFactory, AttributeFactory attrMetaFactory, Visibility visibility) >>>>>>> EntityTypeFactory entityTypeFactory, AttributeFactory attrMetaFactory, Visibility visibility)
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< public void addAttribute(EntityType entityType, AttributeMetaData attr) ======= public void addAttribute(EntityMetaData entityMeta, Attribute attr) >>>>>>> public void addAttribute(EntityType entityType, Attribute attr) <<<<<<< public void updateAttribute(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= public void updateAttribute(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> public void updateAttribute(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< public void deleteAttribute(EntityType entityType, AttributeMetaData attr) ======= public void deleteAttribute(EntityMetaData entityMeta, Attribute attr) >>>>>>> public void deleteAttribute(EntityType entityType, Attribute attr) <<<<<<< private void addAttributeRec(EntityType entityType, AttributeMetaData attr, boolean checkAttrExists) ======= private void addAttributeRec(EntityMetaData entityMeta, Attribute attr, boolean checkAttrExists) >>>>>>> private void addAttributeRec(EntityType entityType, Attribute attr, boolean checkAttrExists) <<<<<<< private void updateAttributeRec(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateAttributeRec(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateAttributeRec(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< private void updateColumn(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateColumn(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateColumn(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< private void updateRefEntity(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateRefEntity(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateRefEntity(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< private void updateEnumOptions(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateEnumOptions(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateEnumOptions(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< private void updateUnique(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateUnique(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateUnique(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< private void deleteAttributeRec(EntityType entityType, AttributeMetaData attr) ======= private void deleteAttributeRec(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void deleteAttributeRec(EntityType entityType, Attribute attr) <<<<<<< private void updateNillable(EntityType entityType, AttributeMetaData attr, AttributeMetaData updatedAttr) ======= private void updateNillable(EntityMetaData entityMeta, Attribute attr, Attribute updatedAttr) >>>>>>> private void updateNillable(EntityType entityType, Attribute attr, Attribute updatedAttr) <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< private void dropForeignKey(EntityType entityType, AttributeMetaData attr) ======= private void dropForeignKey(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void dropForeignKey(EntityType entityType, Attribute attr) <<<<<<< private void createUniqueKey(EntityType entityType, AttributeMetaData attr) ======= private void createUniqueKey(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void createUniqueKey(EntityType entityType, Attribute attr) <<<<<<< private void dropUniqueKey(EntityType entityType, AttributeMetaData attr) ======= private void dropUniqueKey(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void dropUniqueKey(EntityType entityType, Attribute attr) <<<<<<< private void createCheckConstraint(EntityType entityType, AttributeMetaData attr) ======= private void createCheckConstraint(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void createCheckConstraint(EntityType entityType, Attribute attr) <<<<<<< private void dropCheckConstraint(EntityType entityType, AttributeMetaData attr) ======= private void dropCheckConstraint(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void dropCheckConstraint(EntityType entityType, Attribute attr) <<<<<<< private void createColumn(EntityType entityType, AttributeMetaData attr) ======= private void createColumn(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void createColumn(EntityType entityType, Attribute attr) <<<<<<< private void dropColumn(EntityType entityType, AttributeMetaData attr) ======= private void dropColumn(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void dropColumn(EntityType entityType, Attribute attr) <<<<<<< private void updateColumnDataType(EntityType entityType, AttributeMetaData attr) ======= private void updateColumnDataType(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void updateColumnDataType(EntityType entityType, Attribute attr) <<<<<<< private void createJunctionTable(EntityType entityType, AttributeMetaData attr) ======= private void createJunctionTable(EntityMetaData entityMeta, Attribute attr) >>>>>>> private void createJunctionTable(EntityType entityType, Attribute attr) <<<<<<< private void dropJunctionTable(EntityType entityType, AttributeMetaData mrefAttr) ======= private void dropJunctionTable(EntityMetaData entityMeta, Attribute mrefAttr) >>>>>>> private void dropJunctionTable(EntityType entityType, Attribute mrefAttr)
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory;
<<<<<<< public EntityCollectionResponseV2(String href) { this.href = requireNonNull(href); this.meta = null; this.start = null; this.num = null; this.total = null; this.prevHref = null; this.nextHref = null; this.items = null; } public EntityCollectionResponseV2(EntityPager entityPager, List<Map<String, Object>> items, AttributeFilter attributes, String href, EntityMetaData meta, MolgenisPermissionService permissionService) ======= public EntityCollectionResponseV2(EntityPager entityPager, List<Map<String, Object>> items, Fetch fetch, String href, EntityMetaData meta, MolgenisPermissionService permissionService, DataService dataService) >>>>>>> public EntityCollectionResponseV2(String href) { this.href = requireNonNull(href); this.meta = null; this.start = null; this.num = null; this.total = null; this.prevHref = null; this.nextHref = null; this.items = null; } public EntityCollectionResponseV2(EntityPager entityPager, List<Map<String, Object>> items, Fetch fetch, String href, EntityMetaData meta, MolgenisPermissionService permissionService, DataService dataService)
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< Entity e = entityManager.create(entityType, fetch); ======= Entity e = entityManager.createFetch(entityMetaData, fetch); >>>>>>> Entity e = entityManager.createFetch(entityType, fetch); <<<<<<< for (AttributeMetaData attr : entityType.getAtomicAttributes()) ======= for (Attribute attr : entityMetaData.getAtomicAttributes()) >>>>>>> for (Attribute attr : entityType.getAtomicAttributes()) <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute(); <<<<<<< AttributeMetaData idAttr = entityType.getIdAttribute(); ======= Attribute idAttr = entityMeta.getIdAttribute(); >>>>>>> Attribute idAttr = entityType.getIdAttribute();
<<<<<<< r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId(), DETAILED_LABELS); ImmutableList<AccountInfo> ccs = firstNonNull(ci.reviewers.get(ReviewerState.CC), ImmutableList.<AccountInfo>of()) .stream() .sorted(comparing((AccountInfo a) -> a.email)) .collect(toImmutableList()); assertThat(ccs).hasSize(2); assertThat(ccs.get(0).email).isEqualTo("[email protected]"); assertThat(ccs.get(0)._accountId).isNull(); assertThat(ccs.get(1).email).isEqualTo("[email protected]"); assertThat(ccs.get(1)._accountId).isNull(); ======= if (notesMigration.readChanges()) { r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId(), DETAILED_LABELS); ImmutableList<AccountInfo> ccs = firstNonNull(ci.reviewers.get(ReviewerState.CC), ImmutableList.<AccountInfo>of()).stream() .sorted(comparing((AccountInfo a) -> a.email)) .collect(toImmutableList()); assertThat(ccs).hasSize(2); assertThat(ccs.get(0).email).isEqualTo("[email protected]"); assertThat(ccs.get(0)._accountId).isNull(); assertThat(ccs.get(1).email).isEqualTo("[email protected]"); assertThat(ccs.get(1)._accountId).isNull(); } else { r.assertErrorStatus("[email protected] does not identify a registered user"); } >>>>>>> r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId(), DETAILED_LABELS); ImmutableList<AccountInfo> ccs = firstNonNull(ci.reviewers.get(ReviewerState.CC), ImmutableList.<AccountInfo>of()).stream() .sorted(comparing((AccountInfo a) -> a.email)) .collect(toImmutableList()); assertThat(ccs).hasSize(2); assertThat(ccs.get(0).email).isEqualTo("[email protected]"); assertThat(ccs.get(0)._accountId).isNull(); assertThat(ccs.get(1).email).isEqualTo("[email protected]"); assertThat(ccs.get(1)._accountId).isNull();
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< EntityType entityType = mock(EntityType.class); AttributeMetaData msgAttr = when(mock(AttributeMetaData.class).getDataType()).thenReturn(STRING).getMock(); AttributeMetaData nlAttr = when(mock(AttributeMetaData.class).getDataType()).thenReturn(STRING).getMock(); AttributeMetaData enAttr = when(mock(AttributeMetaData.class).getDataType()).thenReturn(STRING).getMock(); when(entityType.getAttribute(I18nStringMetaData.MSGID)).thenReturn(msgAttr); when(entityType.getAttribute("nl")).thenReturn(nlAttr); when(entityType.getAttribute("en")).thenReturn(enAttr); ======= EntityMetaData entityMeta = mock(EntityMetaData.class); Attribute msgAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); Attribute nlAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); Attribute enAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); when(entityMeta.getAttribute(I18nStringMetaData.MSGID)).thenReturn(msgAttr); when(entityMeta.getAttribute("nl")).thenReturn(nlAttr); when(entityMeta.getAttribute("en")).thenReturn(enAttr); >>>>>>> EntityType entityType = mock(EntityType.class); Attribute msgAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); Attribute nlAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); Attribute enAttr = when(mock(Attribute.class).getDataType()).thenReturn(STRING).getMock(); when(entityType.getAttribute(I18nStringMetaData.MSGID)).thenReturn(msgAttr); when(entityType.getAttribute("nl")).thenReturn(nlAttr); when(entityType.getAttribute("en")).thenReturn(enAttr);
<<<<<<< import org.molgenis.data.meta.SystemEntityType; import org.molgenis.data.meta.model.Attribute; ======= import org.molgenis.data.Sort; import org.molgenis.data.meta.SystemEntityMetaData; import org.molgenis.data.meta.model.AttributeMetaData; >>>>>>> import org.molgenis.data.Sort; import org.molgenis.data.meta.SystemEntityType; import org.molgenis.data.meta.model.Attribute; <<<<<<< import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_LABEL; ======= import static org.molgenis.data.Sort.Direction.DESC; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityMetaData.AttributeRole.ROLE_LABEL; >>>>>>> import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_ID; import static org.molgenis.data.meta.model.EntityType.AttributeRole.ROLE_LABEL; import static org.molgenis.data.Sort.Direction.DESC;
<<<<<<< import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; <<<<<<< EntityType entityType = mock(EntityType.class); when(decoratedRepo.getEntityType()).thenReturn(entityType); ======= entityMeta = mock(EntityMetaData.class); when(decoratedRepo.getEntityMetaData()).thenReturn(entityMeta); >>>>>>> entityType = mock(EntityType.class); when(decoratedRepo.getEntityType()).thenReturn(entityType);
<<<<<<< .setDataType(MolgenisFieldTypes.AttributeType.COMPOUND).setLabel(annotator.getSimpleName()); ======= .setDataType(COMPOUND).setLabel(annotator.getSimpleName()); Attribute finalCompound = compound; >>>>>>> .setDataType(COMPOUND).setLabel(annotator.getSimpleName());
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttributeMetaData; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttribute; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttribute; <<<<<<< EntityType targetEntityType = entityTypeFactory.create("target"); AttributeMetaData targetBMIAttribute = attrMetaFactory.create().setName("targetHeight"); ======= EntityMetaData targetEntityMetaData = entityMetaFactory.create("target"); Attribute targetBMIAttribute = attrMetaFactory.create().setName("targetHeight"); >>>>>>> EntityType targetEntityType = entityTypeFactory.create("target"); Attribute targetBMIAttribute = attrMetaFactory.create().setName("targetHeight"); <<<<<<< EntityType sourceEntityType = entityTypeFactory.create("source"); AttributeMetaData heightSourceAttribute = attrMetaFactory.create().setName("sourceHeight"); ======= EntityMetaData sourceEntityMetaData = entityMetaFactory.create("source"); Attribute heightSourceAttribute = attrMetaFactory.create().setName("sourceHeight"); >>>>>>> EntityType sourceEntityType = entityTypeFactory.create("source"); Attribute heightSourceAttribute = attrMetaFactory.create().setName("sourceHeight"); <<<<<<< EntityType targetEntityType = entityTypeFactory.create("target"); AttributeMetaData targetAttribute = attrMetaFactory.create().setName("targetHeight"); ======= EntityMetaData targetEntityMetaData = entityMetaFactory.create("target"); Attribute targetAttribute = attrMetaFactory.create().setName("targetHeight"); >>>>>>> EntityType targetEntityType = entityTypeFactory.create("target"); Attribute targetAttribute = attrMetaFactory.create().setName("targetHeight"); <<<<<<< EntityType sourceEntityType = entityTypeFactory.create("source"); AttributeMetaData sourceAttribute = attrMetaFactory.create().setName("sourceHeight"); ======= EntityMetaData sourceEntityMetaData = entityMetaFactory.create("source"); Attribute sourceAttribute = attrMetaFactory.create().setName("sourceHeight"); >>>>>>> EntityType sourceEntityType = entityTypeFactory.create("source"); Attribute sourceAttribute = attrMetaFactory.create().setName("sourceHeight");
<<<<<<< this.dataService = requireNonNull(dataService); this.jsonValidator = jsonValidator; ======= >>>>>>> this.jsonValidator = jsonValidator;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< annotate(annotator, vcfAttributes, entityTypeFactory, attributeMetaDataFactory, vcfUtils, inputVcfFile, ======= annotate(annotator, vcfAttributes, entityMetaDataFactory, attributeFactory, vcfUtils, inputVcfFile, >>>>>>> annotate(annotator, vcfAttributes, entityTypeFactory, attributeFactory, vcfUtils, inputVcfFile, <<<<<<< EntityTypeFactory entityTypeFactory, AttributeMetaDataFactory attributeMetaDataFactory, ======= EntityMetaDataFactory entityMetaDataFactory, AttributeFactory attributeFactory, >>>>>>> EntityTypeFactory entityTypeFactory, AttributeFactory attributeFactory, <<<<<<< AnnotatorUtils.annotate(annotator, vcfAttributes, entityTypeFactory, attributeMetaDataFactory, vcfUtils, ======= AnnotatorUtils.annotate(annotator, vcfAttributes, entityMetaDataFactory, attributeFactory, vcfUtils, >>>>>>> AnnotatorUtils.annotate(annotator, vcfAttributes, entityTypeFactory, attributeFactory, vcfUtils,
<<<<<<< public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + "background"; public static final String UNIQUEREFERENCE = "background"; public BackgroundController() ======= public static final String ID = "background"; public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + ID; private static final String DEFAULT_KEY_APP_BACKGROUND = "<p>Paste the code</p>"; private static final String KEY_APP_BACKGROUND = "app.background"; private final MolgenisSettings molgenisSettings; @Autowired public BackgroundController(MolgenisSettings molgenisSettings) { super(URI); if (molgenisSettings == null) throw new IllegalArgumentException("molgenisSettings is null"); this.molgenisSettings = molgenisSettings; } @RequestMapping(method = RequestMethod.GET) public String init(Model model) >>>>>>> public static final String ID = "background"; public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + ID; public BackgroundController()
<<<<<<< import org.molgenis.data.file.FileStore; ======= import org.molgenis.data.DataService; import org.molgenis.data.plugin.model.PluginIdentity; >>>>>>> import org.molgenis.data.DataService; import org.molgenis.data.plugin.model.PluginIdentity; import org.molgenis.data.file.FileStore; <<<<<<< when(app.getResourceFolder()).thenReturn("fake-app"); File testJs = new File(AppControllerTest.class.getResource("/fake-app/js/test.js").getFile()); when(fileStore.getFile("fake-app/js/test.js")).thenReturn(testJs); ======= ClassLoader classLoader = getClass().getClassLoader(); File testFile = new File(classLoader.getResource("test-resources/js/test.js").getFile()); String absoluteTestFileResourcePath = testFile.getPath().replace("js/test.js", ""); ; when(app.getResourceFolder()).thenReturn(absoluteTestFileResourcePath); >>>>>>> when(app.getResourceFolder()).thenReturn("fake-app"); File testJs = new File(AppControllerTest.class.getResource("/fake-app/js/test.js").getFile()); when(fileStore.getFile("fake-app/js/test.js")).thenReturn(testJs); <<<<<<< AppController controller = new AppController(appManagerService, appSettings, menuReaderService, fileStore); mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(new GlobalControllerExceptionHandler(), new FallbackExceptionHandler(), new SpringExceptionHandler()) ======= mockMvc = MockMvcBuilders.standaloneSetup(appController) .setControllerAdvice(globalControllerExceptionHandler, fallbackExceptionHandler, springExceptionHandler) >>>>>>> mockMvc = MockMvcBuilders.standaloneSetup(appController) .setControllerAdvice(globalControllerExceptionHandler, fallbackExceptionHandler, springExceptionHandler) <<<<<<< mockMvc.perform(get(AppController.URI + "/uri")).andExpect(status().is3xxRedirection()); ======= PluginIdentity pluginIdentity = new PluginIdentity("uri"); when(userPermissionEvaluator.hasPermission(pluginIdentity, VIEW_PLUGIN)).thenReturn(true); mockMvc.perform(get(AppController.URI + "/uri")).andExpect(status().is3xxRedirection()); >>>>>>> PluginIdentity pluginIdentity = new PluginIdentity("uri"); when(userPermissionEvaluator.hasPermission(pluginIdentity, VIEW_PLUGIN)).thenReturn(true); mockMvc.perform(get(AppController.URI + "/uri")).andExpect(status().is3xxRedirection());
<<<<<<< if (getConversionService() == null) return source.toString(); ======= >>>>>>>
<<<<<<< Repository repo = dataService.getRepository(entityName); Entity entity = null; if (repo.getEntityMetaData().getEntityClass() != Entity.class) entity = BeanUtils.instantiateClass(repo .getEntityMetaData().getEntityClass()); else entity = new MapEntity(); ======= Repository repo = dataService.getRepositoryByEntityName(entityName); >>>>>>> Repository repo = dataService.getRepository(entityName);
<<<<<<< ElasticTestUtils.configure( elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig)); ======= ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration)); >>>>>>> ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig));
<<<<<<< import static org.molgenis.data.i18n.model.LanguageMetaData.*; import static org.molgenis.data.meta.MetaUtils.getEntityTypeFetch; import static org.molgenis.data.meta.model.EntityTypeMetadata.*; ======= import static org.molgenis.data.meta.MetaUtils.getEntityMetaDataFetch; import static org.molgenis.data.meta.model.EntityMetaDataMetaData.*; >>>>>>> import static org.molgenis.data.meta.MetaUtils.getEntityTypeFetch; import static org.molgenis.data.meta.model.EntityTypeMetadata.*; <<<<<<< public Stream<String> getLanguageCodes() { if (isTableExists(LANGUAGE)) { String sql = "SELECT \"" + CODE + "\" FROM \"" + LANGUAGE + '"'; if (LOG.isDebugEnabled()) { LOG.debug("Fetching languages"); if (LOG.isTraceEnabled()) { LOG.trace("SQL: {}", sql); } } return jdbcTemplate.query(sql, (rs, rowNum) -> rs.getString(CODE)).stream(); } else { return Stream.of(DEFAULT_LANGUAGE_CODE); } } @Override public Repository<Entity> createRepository(EntityType entityType) ======= public Repository<Entity> createRepository(EntityMetaData entityMeta) >>>>>>> public Repository<Entity> createRepository(EntityType entityType) <<<<<<< dropColumn(entityType, attr); ======= boolean bidirectionalOneToMany = attr.getDataType() == ONE_TO_MANY && attr.isMappedBy(); if (isMultipleReferenceType(attr) && !bidirectionalOneToMany) { dropJunctionTable(entityMeta, attr); } else { dropColumn(entityMeta, attr); } >>>>>>> boolean bidirectionalOneToMany = attr.getDataType() == ONE_TO_MANY && attr.isMappedBy(); if (isMultipleReferenceType(attr) && !bidirectionalOneToMany) { dropJunctionTable(entityType, attr); } else { dropColumn(entityType, attr); } <<<<<<< // @Transactional FIXME enable when bootstrapping transaction issue has been resolved private void createTable(EntityType entityType) ======= private void createTable(EntityMetaData entityMeta) >>>>>>> private void createTable(EntityType entityType) <<<<<<< getPersistedAttributesMref(entityType).forEach(attr -> createJunctionTable(entityType, attr)); ======= createJunctionTables(entityMeta); } private void createJunctionTables(EntityMetaData entityMeta) { getJunctionTableAttributes(entityMeta).filter(attr -> !attr.isInversedBy()) .forEach(attr -> createJunctionTable(entityMeta, attr)); getJunctionTableAttributes(entityMeta).filter(AttributeMetaData::isInversedBy) .forEach(attr -> createJunctionTable(entityMeta, attr)); >>>>>>> createJunctionTables(entityType); } private void createJunctionTables(EntityType entityType) { getJunctionTableAttributes(entityType).filter(attr -> !attr.isInversedBy()) .forEach(attr -> createJunctionTable(entityType, attr)); getJunctionTableAttributes(entityType).filter(AttributeMetaData::isInversedBy) .forEach(attr -> createJunctionTable(entityType, attr)); <<<<<<< String createJunctionTableIndexSql = getSqlCreateJunctionTableIndex(entityType, attr); if (LOG.isDebugEnabled()) { LOG.debug("Creating junction table index for entity [{}] attribute [{}]", entityType.getName(), attr.getName()); if (LOG.isTraceEnabled()) ======= String createJunctionTableIndexSql = getSqlCreateJunctionTableIndex(entityMeta, attr); if (LOG.isDebugEnabled()) >>>>>>> String createJunctionTableIndexSql = getSqlCreateJunctionTableIndex(entityType, attr); if (LOG.isDebugEnabled())