Package org.apache.cayenne.access.types

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


        SelectQuery query = new SelectQuery(AbstractPerson.class);

        EntityResolver resolver = getDomain().getEntityResolver();
        QueryMetadata md = query.getMetaData(resolver);
        ClassDescriptor descriptor = md.getClassDescriptor();
        ExtendedTypeMap converters = getDomain()
                .getDataNodes()
                .iterator()
                .next()
                .getAdapter()
                .getExtendedTypes();
View Full Code Here


        SelectQuery query = new SelectQuery(AbstractPerson.class);

        EntityResolver resolver = getDomain().getEntityResolver();
        QueryMetadata md = query.getMetaData(resolver);
        ClassDescriptor descriptor = md.getClassDescriptor();
        ExtendedTypeMap converters = getDomain()
                .getDataNodes()
                .iterator()
                .next()
                .getAdapter()
                .getExtendedTypes();
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);
               
           if (query.getColumnNamesCapitalization() != null) {
View Full Code Here

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

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

        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

        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

            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.pkGenerator = createPkGenerator();
        this.quotingStrategy = createQuotingStrategy();

        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
        this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
        this.extendedTypes = new ExtendedTypeMap();
        initExtendedTypes(defaultExtendedTypes, userExtendedTypes, extendedTypeFactories);
    }
View Full Code Here

        list.addAll(keys);
        return list;
    }

    public static String[] getRegisteredTypeNames() {
        String[] srcList = new ExtendedTypeMap().getRegisteredTypeNames();
        Arrays.sort(srcList);

        String[] finalList = new String[srcList.length + 1];
        System.arraycopy(srcList, 0, finalList, 1, srcList.length);
        finalList[0] = "";
View Full Code Here

        domain.removeDataNode(node.getName());

        node.addDataMap(testMap);
        domain.addNode(node);

        ExtendedTypeMap map = node.getAdapter().getExtendedTypes();
        map.registerType(new CAY_207StringType1());
        map.registerType(new CAY_207StringType2());
    }
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.