Package com.buschmais.cdo.api

Examples of com.buschmais.cdo.api.CdoException


    }

    @Override
    public Object invoke(Map<String, Object> entity, Object instance, Object[] args) {
        if (!entity.containsKey(name)) {
            throw new CdoException("Query result does not contain column '" + name + "'");
        }
        Object value = entity.get(name);
        return value != null ? type.cast(value) : null;
    }
View Full Code Here


            String urlName = cdoUnitType.getUrl();
            URI uri;
            try {
                uri = new URI(urlName);
            } catch (URISyntaxException e) {
                throw new CdoException("Cannot convert '" + urlName + "' to url.");
            }
            String providerName = cdoUnitType.getProvider();
            Class<? extends CdoDatastoreProvider> provider = ClassHelper.getType(providerName);
            Set<Class<?>> types = new HashSet<>();
            for (String typeName : cdoUnitType.getTypes().getType()) {
View Full Code Here

            case SINGLETHREADED:
                return ConcurrencyMode.SINGLETHREADED;
            case MULTITHREADED:
                return ConcurrencyMode.MULTITHREADED;
            default:
                throw new CdoException("Unknown conucrrency mode type " + concurrencyModeType);
        }
    }
View Full Code Here

            case NONE:
                return ValidationMode.NONE;
            case AUTO:
                return ValidationMode.AUTO;
            default:
                throw new CdoException("Unknown validation mode type " + validationModeType);
        }
    }
View Full Code Here

            case MANDATORY:
                return Transaction.TransactionAttribute.MANDATORY;
            case REQUIRES:
                return Transaction.TransactionAttribute.REQUIRES;
            default:
                throw new CdoException("Unknown transaction attribute type " + defaultTransactionAttributeType);
        }
    }
View Full Code Here

                if (rowProxyMethodService != null) {
                    RowInvocationHandler invocationHandler = new RowInvocationHandler(row, rowProxyMethodService);
                    return (T) sessionContext.getProxyFactory().createInstance(invocationHandler, returnTypes, CompositeRowObject.class);
                }
                if (row.size() != 1) {
                    throw new CdoException("Only single columns per row can be returned.");
                }
                return (T) row.values().iterator().next();
            }

            @Override
View Full Code Here

        if (parameters == null) {
            parameters = new HashMap<>();
        }
        Object oldValue = parameters.put(name, value);
        if (oldValue != null) {
            throw new CdoException("Parameter '" + name + "' has already been assigned to value '" + value + "'.");
        }
        return sessionContext.getInterceptorFactory().addInterceptor(this);
    }
View Full Code Here

    }

    @Override
    public Query<T> withParameters(Map<String, Object> parameters) {
        if (this.parameters != null) {
            throw new CdoException(("Parameters have already been assigned: " + parameters));
        }
        this.parameters = parameters;
        return sessionContext.getInterceptorFactory().addInterceptor(this);
    }
View Full Code Here

    @Override
    public CdoManagerFactory createCdoManagerFactory(String name) {
        CdoUnit cdoUnit = cdoUnits.get(name);
        if (cdoUnit == null) {
            throw new CdoException("CDO unit with name '" + name + "' does not exist.");
        }
        return createCdoManagerFactory(cdoUnit);
    }
View Full Code Here

            while (resources.hasMoreElements()) {
                URL url = resources.nextElement();
                for (CdoUnit cdoUnit : cdoUnitFactory.getCdoUnits(url)) {
                    CdoUnit existingCdoUnit = result.put(cdoUnit.getName(), cdoUnit);
                    if (existingCdoUnit != null) {
                        throw new CdoException("Found more than one CDO unit with name '" + cdoUnit.getName() + "'.");
                    }
                }
            }
        } catch (IOException e) {
            throw new CdoException("Cannot read cdo.xml descriptors.", e);
        }
        return result;
    }
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.