Examples of CopyHelper


Examples of commonj.sdo.helper.CopyHelper

    }

    @Override
    public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

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

                parent.getChildLevels().add(level);
            }else {
                Nodes contexts = menu.query("contexts/context");
                if(contexts.size()>0) {
                    for(int j=0;j<contexts.size();j++) {
                        MenuLevel copy = new CopyHelper().copy(level);
                        copy.setContext((contexts.get(j)).getValue());
                        result.add(copy);
                    }
                }else {
                    result.add(level);
View Full Code Here

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

    @Produces(MediaType.APPLICATION_JSON)
    public Collection<RecordingEntity> 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"), Arrays.asList("works")), Expose.class);
            } else if (nameContains != null) {
                return new CopyHelper().detachedCopy(repository.findByPartialNameWithRelations(nameContains, Arrays.asList("reference"), Arrays.asList("works")), Expose.class);
            } else {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference"), Arrays.asList("works")), Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

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

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public RecordingEntity 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();
            recording.setLastUpdated(new Date());
            recording.setLastUpdatedBy(super.CHANGED_BY);
            RecordingEntity createdEntity = super.createEntity(recording);
            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();
            recording.setLastUpdated(new Date());
            recording.setLastUpdatedBy(super.CHANGED_BY);
            RecordingEntity updatedEntity = super.updateEntity(id, recording);
            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<TrackEntity> search(@QueryParam("name") String name, @QueryParam("nameContains") String nameContains, @QueryParam("release") String release, @QueryParam("artist") String artist, @QueryParam("work") String work, @QueryParam("recording") String recording) {
        try {
            transactionManager.begin();
            if (name != null) {
                return new CopyHelper().detachedCopy(repository.findByNameWithRelations(name, Arrays.asList("reference"), Arrays.asList("medium")),Expose.class);
            } else if (nameContains != null) {
                return new CopyHelper().detachedCopy(repository.findByPartialNameWithRelations(nameContains, Arrays.asList("reference"), Arrays.asList("medium")),Expose.class);
            } else if (release != null) {
                return new CopyHelper().detachedCopy(repository.findByReleaseWithRelations(release, Arrays.asList("reference","recording","recording.works"), Arrays.asList("medium")),Expose.class);
            } else if (artist != null) {
                return new CopyHelper().detachedCopy(repository.findByArtistWithRelations(artist, Arrays.asList("reference","recording","recording.works"), Arrays.asList("medium")),Expose.class);
            } else if (recording != null) {
                return new CopyHelper().detachedCopy(repository.findByRecordingWithRelations(recording, Arrays.asList("reference"), Arrays.asList("medium")),Expose.class);
            } else if (work != null) {
                return new CopyHelper().detachedCopy(repository.findByWorkWithRelations(work, Arrays.asList("reference"), Arrays.asList("medium")),Expose.class);
            } else {
                return new CopyHelper().detachedCopy(repository.findAllWithRelations(Arrays.asList("reference","recording","recording.works"), Arrays.asList("medium")),Expose.class);
            }
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

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

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public TrackEntity 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();
            track.setLastUpdated(new Date());
            track.setLastUpdatedBy(super.CHANGED_BY);
            TrackEntity createdEntity = super.createEntity(track);
            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();
            track.setLastUpdated(new Date());
            track.setLastUpdatedBy(super.CHANGED_BY);
            TrackEntity updatedEntity = super.updateEntity(id, track);
            getRepository().refresh(updatedEntity);
            return new CopyHelper().copy(updatedEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }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.