Examples of JDOField


Examples of org.apache.jdo.model.jdo.JDOField

     * is needed.
     * @return JDOField metadata for the managed field or <code>null</code>
     * if there is no such field.
     */
    public JDOField getManagedField(String fieldName) {
        JDOField field = getField(fieldName);
        if ((field != null) && !field.isManaged())
            // return null for a non managed field
            return null;
        return field;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        // check fieldName
        if ((fieldName == null) || (fieldName.length() == 0)) {
            return null;
        }
       
        JDOField field = null;
        int index = fieldName.lastIndexOf('.');
        if (index != -1) {
            // qualified field name
            String className = fieldName.substring(0, index);
            fieldName = fieldName.substring(index + 1);
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * @param fieldNumber the number for which field metadata is needed.
     * @return JDOField metadata for the field or <code>null</code>
     * if there is no such field.
     */
    public JDOField getField(int fieldNumber) {  
        JDOField field = null;
        JDOField[] fields = getManagedFields();
        if ((0 <= fieldNumber) && (fieldNumber < fields.length))
            field = fields[fieldNumber];
        return field;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * @return the corresponding JDOField instance if exists;
     * <code>null</code> otherwise.
     */
    protected JDOField getFieldInternal(String fieldName) {
        // first check the declared fields
        JDOField field = (JDOField)declaredFields.get(fieldName);
        if (field != null) {
            return field;
        }
       
        // not in this class => check superclass
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

    protected JDOField[] getDeclaredPrimaryKeyFields() {
        JDOField[] fields = getDeclaredFields();
        JDOField[] tmp = new JDOField[fields.length];
        int length = 0;
        for (int i = 0; i < fields.length; i++) {
            JDOField field = fields[i];
            if (field.isManaged() && field.isPrimaryKey()) {
                tmp[length++] = field;
            }
        }
        // now fill the returned array
        // the array should have the correct length
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        }
   
        // 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.JDOField

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

Examples of org.apache.jdo.model.jdo.JDOField

        }
   
        // not set => calculate
        JavaType type = null;
        if (elementTypeName != null) {
            JDOField jdoField = getDeclaringField();
            JDOClass jdoClass = jdoField.getDeclaringClass();
            JDOModel jdoModel = jdoClass.getDeclaringModel();
            type = TypeSupport.resolveType(jdoModel, elementTypeName,
                                           jdoClass.getPackagePrefix());
            if (type == null) {
                throw new ModelFatalException(
                    msg.msg("EXC_CannotResolveElementType", elementTypeName, //NOI18N
                            jdoField.getName(), jdoClass.getName())); //NOI18N
            }
        }
       
        return type;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * @param jdoClass the declaring JDOClass of the field to be returned.
     * @return a JDOField declared by the specified jdoClass using the
     * specified mappedByName as its mappedBy name.
     */
    public synchronized JDOField resolve(String mappedByName, JDOClass jdoClass) {
        JDOField field = null;
        Map fieldMap = (Map) get(mappedByName);
        if (fieldMap != null) {
            // Get JDOField instance for specified JDOClass instance and
            // remove it directly since it is resolved.
            // Please note, remove returns the removed entry, so we do not
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

            // return mappedBy relationship, if explicitly set by the setter
            return mappedBy;
        }
       
        // not set => check mappedByName of declaring field
        JDOField field = getDeclaringField();
        String mappedByName = field.getMappedByName();
        if (mappedByName != null) {
            // return a JDORelationship instance for the mappedBy field name
            // as stored in the declaring field
            return getInverseRelationship();
        }
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.