Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataRatingByIpId


        rating1 = _repo.save(rating1);

        MetadataRatingByIp rating2 = new MetadataRatingByIp();
        final int newRating = rating1.getRating() * 100;
        rating2.setRating(newRating);
        rating2.setId(new MetadataRatingByIpId(rating1.getId().getMetadataId(), rating1.getId().getIpAddress()));

        MetadataRatingByIp saved = _repo.save(rating2);

        assertEquals(1, _repo.count());

View Full Code Here


    }
    public static MetadataRatingByIp newMetadataRatingByIp(AtomicInteger inc) {
        int val = inc.incrementAndGet();
        MetadataRatingByIp metadataRatingByIp = new MetadataRatingByIp();
        metadataRatingByIp.setRating(1);
        MetadataRatingByIpId id = new MetadataRatingByIpId();
        id.setIpAddress("ip" + val);
        id.setMetadataId(val);
        metadataRatingByIp.setId(id);

        return metadataRatingByIp;
    }
View Full Code Here

     * @throws Exception hmm
     */
    public int rateMetadata(final int metadataId, final String ipAddress, final int rating) throws Exception {
        MetadataRatingByIp ratingEntity = new MetadataRatingByIp();
        ratingEntity.setRating(rating);
        ratingEntity.setId(new MetadataRatingByIpId(metadataId, ipAddress));

        final MetadataRatingByIpRepository ratingByIpRepository = _applicationContext.getBean(MetadataRatingByIpRepository.class);
        ratingByIpRepository.save(ratingEntity);

        //
View Full Code Here

TOP

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

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.