Package org.apache.jdo.model.java

Examples of org.apache.jdo.model.java.JavaType


     * Get the type representation of the array component type.
     * @return the array component type
     */
    public JavaType getElementType() {
        JDOField jdoField = getDeclaringField();
        JavaType fieldType = jdoField.getType();
        return (fieldType != null) ? fieldType.getArrayComponentType() : null;
    }
View Full Code Here


            return persistenceModifier;
        }
       
        // not set => calculate
        int result = PersistenceModifier.UNSPECIFIED;
        JavaType type = getType();
        if (nameHasJDOPrefix()) {
            result = PersistenceModifier.NONE;
        }
        else if (type != null) {
            result = TypeSupport.isPersistenceFieldType(type) ?
View Full Code Here

        boolean dfg = false;
        if (isPrimaryKey()) {
            dfg = false;
        }
        else {
            JavaType type = getType();
            if ((type != null) && type.isValue()) {
                dfg = true;
            }
        }
       
        return dfg;
View Full Code Here

            return embedded.booleanValue();
        }
       
        // not set => calculate
        boolean result = false;
        JavaType type = getType();
        if (type != null) {
            result = TypeSupport.isEmbeddedFieldType(type);
        }
        return result;
    }
View Full Code Here

            // return java field, if explicitly set by the setter
            return javaField;
        }
       
        // not set => calculate
        JavaType javaType = getDeclaringClass().getJavaType();
        return javaType.getJavaField(getName());
    }
View Full Code Here

            // field has persistence modifier none => cannot be a relationship
            return null;
                           
        // check the type if available
        JDORelationship rel = null;
        JavaType type = getType();
        if (type != null) {
            if (type.isValue() || TypeSupport.isValueArrayType(type)) {
                // no relationship
                rel = null;
            }
            else if (type.isJDOSupportedCollection()) {
                rel = createJDOCollectionInternal();
            }
            else if (type.isJDOSupportedMap()) {
                rel = createJDOMapInternal();
            }
            else if (type.isArray()) {
                rel = createJDOArrayInternal();
            }
            else {
                rel = createJDOReferenceInternal();
            }
View Full Code Here

            // return javaProperty, if explicitly set by the setter
            return javaProperty;
        }
       
        // not set => calculate
        JavaType javaType = getDeclaringClass().getJavaType();
        return javaType.getJavaProperty(getName());
    }
View Full Code Here

            // return objectIdClass if explicitly set by the setter
            return objectIdClass;
        }

        // not set => try to resolve ObjectId class
        JavaType type = null;
        String name = getDeclaredObjectIdClassName();
        if (name != null) {
            JavaModel javaModel = getDeclaringModel().getJavaModel();
            type = javaModel.getJavaType(name);
            if (Modifier.isAbstract(type.getModifiers()))
                // do not return ObjectId class if abstract
                type = null;
        }
        else {
            JDOClass superclass = getPersistenceCapableSuperclass();
View Full Code Here

        if (declaredObjectIdClassName != null) {
            // ObjectId is declared, but it might not be qualified
            int index = declaredObjectIdClassName.indexOf('.');
            if (index == -1) {
                // not qualified => try to resolve it
                JavaType type = TypeSupport.resolveType(getDeclaringModel(),
                    declaredObjectIdClassName, getPackagePrefix());
                if (type == null) {
                    throw new ModelFatalException(
                        msg.msg("EXC_CannotResolveObjectIdClass", //NOI18N
                                declaredObjectIdClassName, getName()));
                }
                this.declaredObjectIdClassName = type.getName();
            }
        }
        else {
            // not declared, check for single field ObjectId class
            JDOField[] declaredPKFields = getDeclaredPrimaryKeyFields();
            if ((declaredPKFields != null) && (declaredPKFields.length == 1)) {
                // there is one pk field declared by this class =>
                // check the type
                JavaType fieldType = declaredPKFields[0].getType();
                if (fieldType != null) {
                    return TypeSupport.getSingleFieldObjectIdClassName(
                        fieldType.getName());
                }
            }
        }
        return declaredObjectIdClassName;
    }
View Full Code Here

        if (pcSuperclassName != null) {
            // pcSuperclassName is declared, but it might not be qualified
            int index = pcSuperclassName.indexOf('.');
            if (index == -1) {
                // not qualified => try to resolve it
                JavaType type = TypeSupport.resolveType(getDeclaringModel(),
                    pcSuperclassName, getPackagePrefix());
                if (type == null) {
                    throw new ModelFatalException(
                        msg.msg("EXC_CannotResolvePCSuperClass", //NOI18N
                                pcSuperclassName, getName()));
                }
                this.pcSuperclassName = type.getName();
            }
        }
        return pcSuperclassName;
    }
View Full Code Here

TOP

Related Classes of org.apache.jdo.model.java.JavaType

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.