Package org.socialmusicdiscovery.server.business.model.subjective

Examples of org.socialmusicdiscovery.server.business.model.subjective.CreditEntity


        em.getTransaction().begin();
        try {
            Artist artist = artistRepository.findByName("Whitney Houston").iterator().next();
            Release release = releaseRepository.findByName("The Bodyguard (Original Soundtrack Album)").iterator().next();

            CreditEntity credit = new CreditEntity();
            credit.setArtistPersonId(artist.getId());
            credit.setReleaseRecordingWorkId(release.getId());
            credit.setType("Important contributor");
            credit.setLastUpdated(new Date());
            credit.setLastUpdatedBy("JUnit");
            creditRepository.create(credit);

            Collection<CreditEntity> credits = creditRepository.findCreditsForReleaseRecordingWork(release);
            assert credits != null;
            assert credits.size() == 1;

            credit = credits.iterator().next();
            assert credit != null;
            assert credit.getLastUpdated() != null;
            assert credit.getLastUpdatedBy() != null;
            assert credit.getType().equals("Important contributor");

            artist = artistRepository.findById(credit.getArtistPersonId());
            assert artist != null;
            assert artist.getName().equals("Whitney Houston");

            release = releaseRepository.findById(credit.getReleaseRecordingWorkId());
            assert release != null;
            assert release.getName().equals("The Bodyguard (Original Soundtrack Album)");

        }catch (Exception e) {
            em.getTransaction().rollback();
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.business.model.subjective.CreditEntity

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.