Package org.apache.jdo.model.java

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


     */
    public JavaType getJavaTypeInternal(Class clazz)
    {
        String name = clazz.getName();
        synchronized (types) {
            JavaType javaType = (JavaType)types.get(name);
            if (javaType == null) {
                javaType = newJavaTypeInstance(clazz);
                types.put(name, javaType);
            }
            return javaType;
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

        }
       
        // not set => try to resolve persistence capable superclass
        String name = getPersistenceCapableSuperclassName();
        if (pcSuperclassName != null) {
            JavaType type = TypeSupport.resolveType(
                getDeclaringModel(), pcSuperclassName, getPackagePrefix());
            if (type == null) {
                throw new ModelFatalException(
                    msg.msg("EXC_CannotResolvePCSuperClass", //NOI18N
                            pcSuperclassName, getName()));
            }
            JDOClass jdoClass = type.getJDOClass();
            // pcSuperclassName might be unqualified
            this.pcSuperclassName = type.getName();
            return jdoClass;
        }

        return null;
    }
View Full Code Here

            // return embeddedKey, if explicitly set by the setter
            return embeddedKey.booleanValue();
        }
       
        // not set => calculate
        JavaType type = getKeyType();
        return (type != null) ?
            TypeSupport.isEmbeddedElementType(type) : false;
    }
View Full Code Here

            // return keyType, if explicitly set by the setter
            return keyType;
        }
   
        // not set => calculate
        JavaType type = null;
        if (keyTypeName != null) {
            JDOField jdoField = getDeclaringField();
            JDOClass jdoClass = jdoField.getDeclaringClass();
            JDOModel jdoModel = jdoClass.getDeclaringModel();
            type = TypeSupport.resolveType(jdoModel, keyTypeName,
View Full Code Here

            // return embeddedKey, if explicitly set by the setter
            return embeddedValue.booleanValue();
        }
       
        // not set => calculate
        JavaType type = getValueType();
        return (type != null) ?
            TypeSupport.isEmbeddedElementType(type) : false;
    }
View Full Code Here

            // return valueType, if explicitly set by the setter
            return valueType;
        }
   
        // not set => calculate
        JavaType type = null;
        if (valueTypeName != null) {
            JDOField jdoField = getDeclaringField();
            JDOClass jdoClass = jdoField.getDeclaringClass();
            JDOModel jdoModel = jdoClass.getDeclaringModel();
            type = TypeSupport.resolveType(jdoModel, valueTypeName,
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

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.