Examples of JDOClass


Examples of org.apache.jdo.model.jdo.JDOClass

            // return identity type, if explicitly set by the setter
            return identityType;
        }
       
        // not set => caclulate
        JDOClass pcRoot = getPersistenceCapableRootClass();
        int result = 0;
        if (pcRoot == this) {
            // this is the least-derived pc class
            result = (pcRoot.getDeclaredObjectIdClassName() != null) ?
                JDOIdentityType.APPLICATION : JDOIdentityType.DATASTORE;
        }
        else {
            // get the identityType from the least-derived pc class
            result = pcRoot.getIdentityType();
        }

        return result;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

            if (Modifier.isAbstract(type.getModifiers()))
                // do not return ObjectId class if abstract
                type = null;
        }
        else {
            JDOClass superclass = getPersistenceCapableSuperclass();
            if (superclass != null) {
                type = superclass.getObjectIdClass();
            }
        }
        return type;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

            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;
        }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

     * instance.
     * @param name the name of the inner class
     * @exception ModelException if impossible
     */
    public JDOClass createJDOClass(String name) throws ModelException {
        JDOClass innerClass = (JDOClass)declaredClasses.get(name);
        if (innerClass == null) {
            innerClass = newJDOClassInstance(name);
            declaredClasses.put(name, innerClass);
        }
        return innerClass;
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

     * @return the managed fields of this JDOClass
     */
    public JDOField[] getManagedFields() {
        JDOField[] fields = null;
        JDOField[] declared = getDeclaredManagedFields();
        JDOClass superclass = getPersistenceCapableSuperclass();
        if (superclass == null) {
            // no pc superclass
            fields = declared;
        }
        else {
            // pc superclass
            JDOField[] inherited = superclass.getManagedFields();
            fields = new JDOField[inherited.length+declared.length];
            System.arraycopy(inherited, 0, fields, 0, inherited.length);
            System.arraycopy(declared, 0, fields,
                             inherited.length, declared.length);
        }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

        if (prop != null) {
            return prop;
        }
       
        // not in this class => check superclass
        JDOClass superclass = getPersistenceCapableSuperclass();
        if (superclass != null) {
            return superclass.getAssociatedProperty(name);
        }
       
        // not found => return null
        return null;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

     * represented by this JDOClass.
     * @return number of inherited managed fields
     */
    public int getInheritedManagedFieldCount() {
        int count = 0;
        JDOClass superclass = getPersistenceCapableSuperclass();
        if (superclass != null) {
            count =
                superclass.getInheritedManagedFieldCount() +
                superclass.getDeclaredManagedFieldCount();
        }
   
        return count;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

     * hierarchy of this JDOClass. It returns this JDOClass if it has no
     * persistence-capable superclass.
     * @return the topmost persistence-capable class in the hierarchy.
     */
    public JDOClass getPersistenceCapableRootClass() {
        JDOClass superclass = getPersistenceCapableSuperclass();
        if (superclass == null) {
            // no superclass => return this
            return this;
        }
        else {
            return superclass.getPersistenceCapableRootClass();
        }
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

   
        // 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,
                                           jdoClass.getPackagePrefix());
            if (type == null) {
                throw new ModelFatalException(
                    msg.msg("EXC_CannotResolveKeyType", keyTypeName, //NOI18N
                            jdoField.getName(), jdoClass.getName()));
            }
        }
       
        return type;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOClass

   
        // 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,
                                           jdoClass.getPackagePrefix());
            if (type == null) {
                throw new ModelFatalException(
                    msg.msg("EXC_CannotResolveValueType", valueTypeName, //NOI18N
                            jdoField.getName(), jdoClass.getName()));
            }
        }
       
        return type;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.