Examples of CopyHelper


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

    @Produces(MediaType.APPLICATION_JSON)
    public Collection<PlayableElementEntity> search(@QueryParam("uri") String uri, @QueryParam("uriContains") String uriContains, @QueryParam("smdID") String smdID) {
        try {
            transactionManager.begin();
            if (uri != null) {
                return new CopyHelper().detachedCopy(repository.findByURIWithRelations(uri, Arrays.asList("reference"), null),Expose.class);
            }else if (uriContains != null) {
                return new CopyHelper().detachedCopy(repository.findByPartialURIWithRelations(uriContains, Arrays.asList("reference"), null),Expose.class);
            } else if (smdID != null) {
                return new CopyHelper().detachedCopy(repository.findBySmdIDWithRelations(smdID, 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 PlayableElementEntity 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

    public PlayableElementEntity create(PlayableElementEntity playableElement) {
        try {
            transactionManager.begin();
            playableElement.setLastUpdated(new Date());
            playableElement.setLastUpdatedBy(super.CHANGED_BY);
            return new CopyHelper().copy(super.createEntity(playableElement), Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

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

    public PlayableElementEntity update(@PathParam("id") String id, PlayableElementEntity playableElement) {
        try {
            transactionManager.begin();
            playableElement.setLastUpdated(new Date());
            playableElement.setLastUpdatedBy(super.CHANGED_BY);
            return new CopyHelper().copy(super.updateEntity(id, playableElement), 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<PersonEntity> 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

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

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public PersonEntity 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();
            person.setLastUpdated(new Date());
            person.setLastUpdatedBy(super.CHANGED_BY);
            PersonEntity createdEntity = super.createEntity(person);
            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();
            person.setLastUpdated(new Date());
            person.setLastUpdatedBy(super.CHANGED_BY);
            PersonEntity updatedEntity = super.updateEntity(id, person);
            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

     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Collection<ConfigurationParameterEntity> getParameters(@QueryParam("path") String path) {
        if(path!=null) {
            return new CopyHelper().detachedCopy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParametersByPath(path), Expose.class);
        }else {
            return new CopyHelper().detachedCopy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParameters(), Expose.class);
        }
    }
View Full Code Here

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

     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public ConfigurationParameter getParameter(@PathParam("id") String id) {
        return new CopyHelper().copy(new MergedConfigurationManager(new PersistentConfigurationManager()).getParameter(id), Expose.class);
    }
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.