Package org.apache.cayenne.access.types

Examples of org.apache.cayenne.access.types.ExtendedTypeMap


        if (node == null) {
            throw new CayenneRuntimeException("No DataNode found for objEntity: "
                    + objEntity.getName());
        }

        ExtendedTypeMap types = node.getAdapter().getExtendedTypes();

        // validate mandatory attributes

        // handling a special case - meaningful mandatory FK... defer failures until
        // relationship validation is done... This is just a temporary solution, as
        // handling meaningful keys within the object lifecycle requires something more,
        // namely read/write methods for relationships and direct values should be
        // synchronous with each other..
        Map failedDbAttributes = null;

        Iterator attributes = objEntity.getAttributes().iterator();
        while (attributes.hasNext()) {
            ObjAttribute objAttribute = (ObjAttribute) attributes.next();
            DbAttribute dbAttribute = objAttribute.getDbAttribute();

            Object value = this.readPropertyDirectly(objAttribute.getName());
            if (dbAttribute.isMandatory()) {
                ValidationFailure failure = BeanValidationFailure.validateNotNull(
                        this,
                        objAttribute.getName(),
                        value);

                if (failure != null) {

                    if (failedDbAttributes == null) {
                        failedDbAttributes = new HashMap();
                    }

                    failedDbAttributes.put(dbAttribute.getName(), failure);
                    continue;
                }
            }

            if (value != null) {

                // TODO: should we pass null values for validation as well?
                // if so, class can be obtained from ObjAttribute...

                types.getRegisteredType(value.getClass()).validateProperty(
                        this,
                        objAttribute.getName(),
                        value,
                        dbAttribute,
                        validationResult);
View Full Code Here


            OperationObserver callback,
            long startTime) throws Exception {

        boolean iteratedResult = callback.isIteratedResult();

        ExtendedTypeMap types = adapter.getExtendedTypes();
        RowDescriptorBuilder builder = configureRowDescriptorBuilder(compiled, resultSet);

        JDBCResultIterator result = new JDBCResultIterator(
                connection,
                statement,
View Full Code Here

            OperationObserver callback,
            long startTime) throws Exception {

        boolean iteratedResult = callback.isIteratedResult();

        ExtendedTypeMap types = getAdapter().getExtendedTypes();
        RowDescriptorBuilder builder = configureRowDescriptorBuilder(compiled, resultSet);

        JDBCResultIterator result = new JDBCResultIterator(
                connection,
                statement,
View Full Code Here

        // TODO: andrus 05.02.2010 - ideally this should be injected
        this.resourceLocator = new ClassLoaderResourceLocator();

        this.pkGenerator = createPkGenerator();
        this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
        this.extendedTypes = new ExtendedTypeMap();
        this.configureExtendedTypes(extendedTypes);
        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
        initIdentifiersQuotes();

    }
View Full Code Here

            OperationObserver callback,
            long startTime) throws Exception {

        boolean iteratedResult = callback.isIteratedResult();

        ExtendedTypeMap types = adapter.getExtendedTypes();
        RowDescriptor descriptor = (compiled.getResultColumns().length > 0)
                ? new RowDescriptor(compiled.getResultColumns(), types)
                : new RowDescriptor(resultSet, types);

        JDBCResultIterator result = new JDBCResultIterator(
View Full Code Here

        this.setSupportsUniqueConstraints(true);
        this.setSupportsFkConstraints(true);

        this.pkGenerator = createPkGenerator();
        this.typesHandler = TypesHandler.getHandler(findAdapterResource("/types.xml"));
        this.extendedTypes = new ExtendedTypeMap();
        this.configureExtendedTypes(extendedTypes);
        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
    }
View Full Code Here

        this.setSupportsUniqueConstraints(true);
        this.setSupportsFkConstraints(true);

        this.pkGenerator = createPkGenerator();
        this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
        this.extendedTypes = new ExtendedTypeMap();
        this.configureExtendedTypes(extendedTypes);
        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
    }
View Full Code Here

            OperationObserver callback,
            long startTime) throws Exception {

        boolean iteratedResult = callback.isIteratedResult();
       
        ExtendedTypeMap types = adapter.getExtendedTypes();
        RowDescriptorBuilder builder = configureRowDescriptorBuilder(compiled, resultSet);

        JDBCResultIterator result = new JDBCResultIterator(
                connection,
                statement,
View Full Code Here

        list.addAll(keys);
        return list;
    }

    public static String[] getRegisteredTypeNames() {
        String[] explicitList = new ExtendedTypeMap().getRegisteredTypeNames();
        Set<String> nonPrimitives = new HashSet<String>(Arrays.asList(explicitList));

        // add types that are not mapped explicitly, but nevertheless supported by Cayenne
        nonPrimitives.add(Calendar.class.getName());
        nonPrimitives.add(BigInteger.class.getName());
View Full Code Here

        // TODO: andrus 05.02.2010 - ideally this should be injected
        this.resourceLocator = new ClassLoaderResourceLocator();
       
        this.pkGenerator = createPkGenerator();
        this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
        this.extendedTypes = new ExtendedTypeMap();
        this.configureExtendedTypes(extendedTypes);
        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
        initIdentifiersQuotes();
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.access.types.ExtendedTypeMap

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.