Package org.caffinitas.mapper.annotations

Examples of org.caffinitas.mapper.annotations.DataTypeName


        collectionDataType = keyDataType;
        mapValueDataType = valueDataType;
    }

    private DataType collectionElementType(DataModel model, CColumn elemCol, int typeIndex, int typeCount) {
        DataTypeName elemDataTypeName = elemCol != null ? elemCol.type() : DataTypeName.GUESS;
        Class<?> elemType = GenericTypes.getGenericType(attrGenericType, typeIndex, typeCount);
        if (typeIndex == 0) {
            collectionElementTypeJava = elemType;
        } else if (typeIndex == 1) {
            mapValueElementTypeJava = elemType;
        }
        if (elemDataTypeName == DataTypeName.GUESS) {
            elemDataTypeName = guessSimpleType(elemType);
        }
        if (elemDataTypeName == null) {
            ParseComposite comp = model.composites.get(elemType);
            if (comp != null && comp.composite.compositeType().isSingleColumn()) {
                return DataType.custom("");
            }
        }
        if (elemDataTypeName == null) {
            throw new ModelParseException("cannot determine data type for element " + accessible);
        }
        if (!elemDataTypeName.isForCollection()) {
            throw new ModelParseException("type " + elemDataTypeName + " is not a valid data type at " + accessible);
        }
        return createSimpleDataType(elemCol, elemDataTypeName);
    }
View Full Code Here


    static DataTypeName guessDataTypeName(Class<?> attrType, CDenormalized denormalized, AccessibleObject accessible) {
        // TODO this functionality to guess DataTypeName into a separate class and define an API to extend it
        // TODO converter integration might be required to guess correct DataTypeName

        DataTypeName simple = guessSimpleType(attrType);
        if (simple != null) {
            return simple;
        }
        if (List.class.isAssignableFrom(attrType)) {
            return DataTypeName.LIST;
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.annotations.DataTypeName

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.