Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataRelationId


    public void testHasMetadataId() throws Exception {
        Metadata metadata1 = _metadataRepo.save(newMetadata(_inc));
        Metadata metadata2 = _metadataRepo.save(newMetadata(_inc));

        MetadataRelation relation = new MetadataRelation();
        relation.setId(new MetadataRelationId(metadata1.getId(), metadata2.getId()));
        _repo.save(relation);

        assertEquals(1, _repo.count(hasMetadataId(metadata1.getId())));
        assertEquals(0, _repo.count(hasMetadataId(metadata2.getId())));
    }
View Full Code Here


    public void testHasRelatedId() throws Exception {
        Metadata metadata1 = _metadataRepo.save(newMetadata(_inc));
        Metadata metadata2 = _metadataRepo.save(newMetadata(_inc));

        MetadataRelation relation = new MetadataRelation();
        relation.setId(new MetadataRelationId(metadata1.getId(), metadata2.getId()));
        _repo.save(relation);

        assertEquals(0, _repo.count(hasRelatedId(metadata1.getId())));
        assertEquals(1, _repo.count(hasRelatedId(metadata2.getId())));
    }
View Full Code Here

        boolean exist = false;
    if (count == 1) {
      exist = true;
    } else {
            MetadataRelation entity = new MetadataRelation().setId(new MetadataRelationId(parentId, childId));
            metadataRelationRepository.save(entity);
    }
   
    Element response = new Element(Jeeves.Elem.RESPONSE)
        .setAttribute("alreadyExist", String.valueOf(exist))
View Full Code Here

                params, context, Params.PARENT_UUID, Params.PARENT_ID));
    int childId = Integer.parseInt(Utils.getIdentifierFromParameters(
        params, context, Params.CHILD_UUID, Params.CHILD_ID));

        final MetadataRelationRepository relationRepository = context.getBean(MetadataRelationRepository.class);
        relationRepository.delete(new MetadataRelationId(parentId, childId));

    return new Element(Jeeves.Elem.RESPONSE);
  }
View Full Code Here

    public static MetadataRelation newMetadataRelation(AtomicInteger inc, MetadataRepository metadataRepo) {
        Metadata metadata1 = metadataRepo.save(newMetadata(inc));
        Metadata metadata2 = metadataRepo.save(newMetadata(inc));

        MetadataRelation relation = new MetadataRelation();
        relation.setId(new MetadataRelationId(metadata1.getId(), metadata2.getId()));

        return relation;
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.MetadataRelationId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.