Package org.eclipse.persistence.internal.jpa.metadata.accessors.objects

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField


                    getDescriptor().addPKClassId(metadataMethod.getAttributeName(), metadataMethod.getRelationType());
                }
            }   
        } else {
            for (Field field : MetadataHelper.getFields(m_idClass)) {
                MetadataField metadataField = new MetadataField(field, getLogger());
               
                // The is valid check will throw an exception if needed.
                if (metadataField.isValidPersistenceField(false, getDescriptor())) {
                    getDescriptor().addPKClassId(field.getName(), field.getGenericType());
                }
            }
        }
    }
View Full Code Here


                    Field field = MetadataHelper.getFieldForName(accessor.getName(), getJavaClass());
               
                    if (field == null) {
                        throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
                    } else {
                        MetadataField metadataField = new MetadataField(field, getEntityMappings());
                   
                        // True will force an exception to be thrown if it is
                        // not a valid field. However, if it is a transient
                        // accessor, don't validate it and just let it through.
                        if (accessor.isTransient() || metadataField.isValidPersistenceField(getDescriptor(), true)) {
                            accessibleObject = metadataField;
                        }
                    }
                }
               
View Full Code Here

    /**
     * INTERNAL:
     */
    protected boolean havePersistenceAnnotationsDefined(Field[] fields) {
        for (Field field : fields) {
            MetadataField metadataField = new MetadataField(field, getLogger());
           
            if (metadataField.hasDeclaredAnnotations(getDescriptor())) {
                return true;
            }
        }
       
        return false;
View Full Code Here

     * setting and for a field to be processed it must have a Access(FIELD)
     * setting.
     */
    protected void processAccessorFields(boolean processingInverse) {
        for (Field field : MetadataHelper.getFields(getJavaClass())) {
            MetadataField metadataField = new MetadataField(field, getLogger());
            if (metadataField.isAnnotationPresent(Transient.class)) {
                if (metadataField.hasMoreThanOneDeclaredAnnotation(getDescriptor())) {
                    throw ValidationException.mappingAnnotationsAppliedToTransientAttribute(field);
                }
            } else {
                // The is valid check will throw an exception if needed.
                if (metadataField.isValidPersistenceField(processingInverse, getDescriptor())) {
                    // If the accessor already exists, it may have come from XML
                    // or because of an explicit access type setting. E.G.
                    // Access type is property and we processed the access
                    // methods for this field, however the field has been tagged
                    // as access field. We must therefore overwrite the previous
                    // accessor with this explicit one.
                    if (! getDescriptor().hasAccessorFor(metadataField.getAttributeName()) || (getDescriptor().hasAccessorFor(metadataField.getAttributeName()) && processingInverse)) {
                        getDescriptor().addAccessor(buildAccessor(metadataField));
                    }
                }
            }
        }
View Full Code Here

                    getDescriptor().addPKClassId(metadataMethod.getAttributeName(), metadataMethod.getRelationType());
                }
            }   
        } else {
            for (Field field : MetadataHelper.getFields(m_idClass)) {
                MetadataField metadataField = new MetadataField(field, getLogger());
               
                // The is valid check will throw an exception if needed.
                if (metadataField.isValidPersistenceField(getDescriptor())) {
                    getDescriptor().addPKClassId(field.getName(), field.getGenericType());
                }
            }
        }
    }
View Full Code Here

    /**
     * INTERNAL:
     */
    protected boolean havePersistenceAnnotationsDefined(Field[] fields) {
        for (Field field : fields) {
            MetadataField metadataField = new MetadataField(field, getLogger());
           
            if (metadataField.hasDeclaredAnnotations(getDescriptor())) {
                return true;
            }
        }
       
        return false;
View Full Code Here

     * INTERNAL:
     * Create mappings from the fields directly.
     */
    protected void processAccessorFields() {
        for (Field field : MetadataHelper.getFields(getJavaClass())) {
            MetadataField metadataField = new MetadataField(field, getLogger());
            if (metadataField.isAnnotationPresent(Transient.class)) {
                if (metadataField.hasMoreThanOneDeclaredAnnotation(getDescriptor())) {
                    throw ValidationException.mappingAnnotationsAppliedToTransientAttribute(field);
                }
            } else {
                // The is valid check will throw an exception if needed. If
                // we already have an accessor then we loaded one from XML
                // and we shouldn't re-process the accessor.
                if (metadataField.isValidPersistenceField(getDescriptor()) && ! getDescriptor().hasAccessorFor(metadataField.getAttributeName())) {
                    processAccessor(buildAccessor(metadataField));
                }
            }
        }
    }
View Full Code Here

                    Field field = MetadataHelper.getFieldForName(accessor.getName(), getJavaClass());
               
                    if (field == null) {
                        throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
                    } else {
                        MetadataField metadataField = new MetadataField(field, getEntityMappings());
                   
                        // True will force an exception to be thrown if it is
                        // not a valid field. However, if it is a transient
                        // accessor, don't validate it and just let it through.
                        if (accessor.isTransient() || metadataField.isValidPersistenceField(getDescriptor(), true)) {
                            accessibleObject = metadataField;
                        }
                    }
                }
               
View Full Code Here

                    getDescriptor().addPKClassId(metadataMethod.getAttributeName(), metadataMethod.getRelationType());
                }
            }   
        } else {
            for (Field field : MetadataHelper.getFields(m_idClass)) {
                MetadataField metadataField = new MetadataField(field, getLogger());
               
                // The is valid check will throw an exception if needed.
                if (metadataField.isValidPersistenceField(false, getDescriptor())) {
                    getDescriptor().addPKClassId(field.getName(), field.getGenericType());
                }
            }
        }
    }
View Full Code Here

                    Field field = MetadataHelper.getFieldForName(accessor.getName(), getJavaClass());
               
                    if (field == null) {
                        throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
                    } else {
                        MetadataField metadataField = new MetadataField(field, getEntityMappings());
                   
                        // True will force an exception to be thrown if it is
                        // not a valid field. However, if it is a transient
                        // accessor, don't validate it and just let it through.
                        if (accessor.isTransient() || metadataField.isValidPersistenceField(getDescriptor(), true)) {
                            accessibleObject = metadataField;
                        }
                    }
                }
               
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField

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.