Package org.socialmusicdiscovery.server.support.copy

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


        try {
            transactionManager.begin();
            if (id != null && !entity.getId().equals(id)) {
                entity.setId(id);
            }
            return new CopyHelper().copy(super.updateEntity(entity), Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here


    @Produces(MediaType.APPLICATION_JSON)
    public Collection<ArtistEntity> search(@QueryParam("name") String name, @QueryParam("nameContains") String nameContains, @QueryParam("release") String release, @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 (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

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

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

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

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Collection<RecordingSessionEntity> search() {
        try {
            transactionManager.begin();
            return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), null), Expose.class);
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

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

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

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

    @Produces(MediaType.APPLICATION_JSON)
    public Collection<LabelEntity> search(@QueryParam("name") String name, @QueryParam("nameContains") String nameContains) {
        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 {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), null), Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.support.copy.CopyHelper$Cache

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.