Package com.buschmais.cdo.api

Examples of com.buschmais.cdo.api.CdoException


        IndexedPropertyMethodMetadata<?> indexedProperty = typeMetadata.getDatastoreMetadata().getIndexedProperty();
        if (indexedProperty == null) {
            indexedProperty = typeMetadata.getIndexedProperty();
        }
        if (indexedProperty == null) {
            throw new CdoException("Type " + typeMetadata.getAnnotatedType().getAnnotatedElement().getName() + " has no indexed property.");
        }
        PrimitivePropertyMethodMetadata<PrimitivePropertyMetadata> propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
        ResourceIterable<Node> nodesByLabelAndProperty = getGraphDatabaseService().findNodesByLabelAndProperty(discriminator, propertyMethodMetadata.getDatastoreMetadata().getName(), value);
        ResourceIterator<Node> iterator = nodesByLabelAndProperty.iterator();
        return new ResourceResultIterator(iterator);
View Full Code Here


            return (String) expression;
        } else if (expression instanceof Class<?>) {
            Class<?> typeExpression = (Class) expression;
            Cypher cypher = typeExpression.getAnnotation(Cypher.class);
            if (cypher == null) {
                throw new CdoException(typeExpression.getName() + " must be annotated with " + Cypher.class.getName());
            }
            return cypher.value();
        }
        throw new CdoException("Unsupported query expression " + expression);
    }
View Full Code Here

            case FROM:
                return source.createRelationshipTo(target, metadata.getDatastoreMetadata().getDiscriminator());
            case TO:
                return target.createRelationshipTo(source, metadata.getDatastoreMetadata().getDiscriminator());
            default:
                throw new CdoException("Unsupported direction " + direction);
        }
    }
View Full Code Here

            case FROM:
                return Direction.OUTGOING;
            case TO:
                return Direction.INCOMING;
            default:
                throw new CdoException("Unsupported direction " + direction);
        }
    }
View Full Code Here

        URI uri = cdoUnit.getUri();
        DatastoreFactory datastoreFactory = lookupFactory(uri);
        try {
            return datastoreFactory.createGraphDatabaseService(uri);
        } catch (MalformedURLException e) {
            throw new CdoException("Cannot create datastore.", e);
        }

    }
View Full Code Here

        LOG.debug("try to lookup provider-class {}", factoryClass);

        try {
            return ((Class<? extends DatastoreFactory>) Class.forName(factoryClass)).newInstance();
        } catch (ReflectiveOperationException e) {
            throw new CdoException("Cannot create datastore factory.", e);
        }
    }
View Full Code Here

        private Transaction transaction;

        @Override
        public void begin() {
            if (transaction != null) {
                throw new CdoException("There is already an existing transaction.");
            }
            transaction = getGraphDatabaseService().beginTx();
        }
View Full Code Here

        IndexedPropertyMethodMetadata<?> indexedProperty = entityTypeMetadata.getDatastoreMetadata().getIndexedProperty();
        if (indexedProperty == null) {
            indexedProperty = entityTypeMetadata.getIndexedProperty();
        }
        if (indexedProperty == null) {
            throw new CdoException("Type " + entityTypeMetadata.getAnnotatedType().getAnnotatedElement().getName() + " has no indexed property.");
        }
        PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
        ResourceIterable<Node> nodesByLabelAndProperty = getGraphDatabaseService().findNodesByLabelAndProperty(discriminator, propertyMethodMetadata.getDatastoreMetadata().getName(), value);
        ResourceIterator<Node> iterator = nodesByLabelAndProperty.iterator();
        return new ResourceResultIterator(iterator);
View Full Code Here

            return (String) expression;
        } else if (expression instanceof AnnotatedElement) {
            AnnotatedElement typeExpression = (AnnotatedElement) expression;
            Cypher cypher = typeExpression.getAnnotation(Cypher.class);
            if (cypher == null) {
                throw new CdoException(typeExpression + " must be annotated with " + Cypher.class.getName());
            }
            return cypher.value();
        }
        throw new CdoException("Unsupported query expression " + expression);
    }
View Full Code Here

            CdoManagerFactory cdoManagerFactory = cdoBootstrapService.createCdoManagerFactory(name);
            if (cdoManagerFactory != null) {
                return cdoManagerFactory;
            }
        }
        throw new CdoException("Cannot bootstrap CDO implementation.");
    }
View Full Code Here

TOP

Related Classes of com.buschmais.cdo.api.CdoException

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.