Package org.socialmusicdiscovery.server.support.copy

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


    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

    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

    @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

    @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

            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

            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

     */
    @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

     */
    @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

    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public ConfigurationParameterEntity createParameter(ConfigurationParameterEntity parameter) throws JSONException {
        try {
            transactionManager.begin();
            return new CopyHelper().copy(super.createEntity(parameter), Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

TOP

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

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.