Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataRelation


    @Test
    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


    @Test
    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

    @Autowired
    MetadataRepository _metadataRepo;

    @Test
    public void testFindOne() {
        MetadataRelation relation = newMetadataRelation();
        relation = _repo.save(relation);

        MetadataRelation relation1 = newMetadataRelation();
        relation1 = _repo.save(relation1);

        assertEquals(relation1, _repo.findOne(relation1.getId()));
        assertEquals(relation, _repo.findOne(relation.getId()));
    }
View Full Code Here

        assertEquals(relation, _repo.findOne(relation.getId()));
    }

    @Test
    public void testFindAllById_MetadataId() {
        MetadataRelation relation = newMetadataRelation();
        relation = _repo.save(relation);

        MetadataRelation relation1 = newMetadataRelation();
        _repo.save(relation1);

        final List<MetadataRelation> found = _repo.findAllById_MetadataId(relation.getId().getMetadataId());

        assertEquals(1, found.size());
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.MetadataRelation

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.