Package org.apache.jdo.model.jdo

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


     * superclasses.
     * @param jdoClass the class to be checked
     */
    private void checkSuperclass(JDOClass jdoClass) {
        if (jdoClass != null) {
            JDOClass superclass = jdoClass.getPersistenceCapableSuperclass();
            checkSuperclass(superclass);
        }
    }
View Full Code Here


     */
    public synchronized JavaField getDeclaredJavaField(String fieldName)
    {
        JavaField javaField = (JavaField)declaredJavaFields.get(fieldName);
        if (javaField == null) {
            JDOClass jdoClass = getJDOClass();
            if (jdoClass != null) {
                // pc class => look for JDOField first
                if (jdoClass.getDeclaredField(fieldName) != null) {
                    // Use JDO metadata and create a JavaField skeleton to
                    // avoid unnecessary reflection access.
                    javaField = newJavaFieldInstance(fieldName, null);
                    declaredJavaFields.put(fieldName, javaField);
                }
View Full Code Here

            // 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

            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

            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

     * 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

     * @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

        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

     * 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

     * 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

TOP

Related Classes of org.apache.jdo.model.jdo.JDOClass

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.