Examples of CopyHelper


Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    public Collection<ReleaseEntity> search(@QueryParam("name") String name, @QueryParam("nameContains") String nameContains, @QueryParam("artist") String artist, @QueryParam("work") String work, @QueryParam("label") String label) {
        try {
            transactionManager.begin();
            if (name != null) {
                return new CopyHelper().detachedCopy(repository.findByNameWithRelations(name, Arrays.asList("reference"), null), Expose.class);
            } else if (nameContains != null) {
                return new CopyHelper().detachedCopy(repository.findByPartialNameWithRelations(nameContains, Arrays.asList("reference"), null), Expose.class);
            } else if (artist != null) {
                return new CopyHelper().detachedCopy(repository.findByArtistWithRelations(artist, Arrays.asList("reference"), null), Expose.class);
            } else if (work != null) {
                return new CopyHelper().detachedCopy(repository.findByWorkWithRelations(work, Arrays.asList("reference"), null), Expose.class);
            } else if (label != null) {
                return new CopyHelper().detachedCopy(repository.findByLabelWithRelations(label, Arrays.asList("reference"), null), Expose.class);
            } else {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), null), Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public ReleaseEntity get(@PathParam("id") String id) {
        try {
            transactionManager.begin();
            return new CopyHelper().copy(super.getEntity(id), Expose.class);
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            release.setLastUpdated(new Date());
            release.setLastUpdatedBy(super.CHANGED_BY);
            ReleaseEntity createdEntity = super.createEntity(release);
            getRepository().refresh(createdEntity);
            return new CopyHelper().copy(createdEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            release.setLastUpdated(new Date());
            release.setLastUpdatedBy(super.CHANGED_BY);
            ReleaseEntity updatedEntity = super.updateEntity(id, release);
            getRepository().refresh(updatedEntity);
            return new CopyHelper().copy(updatedEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

                }else {
                    return new ArrayList<ContributorEntity>();
                }
            }
            if(release!=null) {
                return new CopyHelper().detachedCopy(repository.findByReleaseWithRelations(release, Arrays.asList("reference"), null), Expose.class);
            }else if (work != null) {
                return new CopyHelper().detachedCopy(repository.findByWorkWithRelations(work, Arrays.asList("reference"), null), Expose.class);
            }else if (recording != null) {
                return new CopyHelper().detachedCopy(repository.findByRecordingWithRelations(recording, Arrays.asList("reference"), null), Expose.class);
            }else if (recordingSession != null) {
                return new CopyHelper().detachedCopy(repository.findByRecordingSessionWithRelations(recordingSession, Arrays.asList("reference"), null), Expose.class);
            }else if (artist!=null) {
                return new CopyHelper().detachedCopy(repository.findByArtistWithRelations(artist, Arrays.asList("reference"), null), Expose.class);
            } else {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), null), Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public ContributorEntity get(@PathParam("id") String id) {
        try {
            transactionManager.begin();
            return new CopyHelper().copy(super.getEntity(id), Expose.class);
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            contributor.setLastUpdated(new Date());
            contributor.setLastUpdatedBy(super.CHANGED_BY);
            ContributorEntity createdEntity = super.createEntity(contributor);
            getRepository().refresh(createdEntity);
            return new CopyHelper().copy(createdEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            contributor.setLastUpdated(new Date());
            contributor.setLastUpdatedBy(super.CHANGED_BY);
            ContributorEntity updatedEntity = super.updateEntity(id, contributor);
            getRepository().refresh(updatedEntity);
            return new CopyHelper().copy(updatedEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    public Collection<WorkEntity> search(@QueryParam("name") String name, @QueryParam("nameContains") String nameContains, @QueryParam("release") String release, @QueryParam("artist") String artist, @QueryParam("work") String work) {
        try {
            transactionManager.begin();
            if (name != null) {
                return new CopyHelper().detachedCopy(repository.findByNameWithRelations(name, Arrays.asList("reference"), null), Expose.class);
            } else if (nameContains != null) {
                return new CopyHelper().detachedCopy(repository.findByPartialNameWithRelations(nameContains, Arrays.asList("reference"), null), Expose.class);
            } else if (release != null) {
                return new CopyHelper().detachedCopy(repository.findByReleaseWithRelations(release, Arrays.asList("reference"), null), Expose.class);
            } else if (artist != null) {
                return new CopyHelper().detachedCopy(repository.findByArtistWithRelations(artist, Arrays.asList("reference"), null), Expose.class);
            } else if (work != null) {
                return new CopyHelper().detachedCopy(repository.findByWorkWithRelations(work, Arrays.asList("reference"), null), Expose.class);
            } else {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), null), Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public WorkEntity get(@PathParam("id") String id) {
        try {
            transactionManager.begin();
            return new CopyHelper().copy(super.getEntity(id), Expose.class);
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.