find a relation specifing parent field name, that is the name of the
relation

@param parentFieldName
@return
176573
public Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> findRelationByParentProperty(
			String parentFieldName) {
		for (Touple<SQLProperty, String, SQLiteEntity, SQLRelationType> item : relations) {
			if (item.value0.getName().equals(parentFieldName)) {
				return item;
			}
		}

		return null;
	}
1160542
public static FieldCoordinates coordinates(String parentType, String fieldName) {
        assertValidName(parentType);
        assertValidName(fieldName);
        return new FieldCoordinates(parentType, fieldName);
    }
207802
public List<String> getFieldNamesPlusParents() {
        List<String> tmp = new ArrayList<String>();
        tmp.addAll(getFieldNames());
        if (extend != null && !extend.equals("")) {
            Struct parent = contract.getStructs().get(extend);
            tmp.addAll(parent.getFieldNamesPlusParents());
        }
        return tmp;
    }
1360659
public static String getMappedName(EntityMetadata parentMetadata, Relation relation,
            final KunderaMetadata kunderaMetadata)
    {
        if (relation != null)
        {
            String joinColumn = relation.getJoinColumnName(kunderaMetadata);
            if (joinColumn == null)
            {
                Class clazz = relation.getTargetEntity();
                EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz);

                joinColumn = relation.getType().equals(ForeignKey.ONE_TO_MANY) ? ((AbstractAttribute) parentMetadata
                        .getIdAttribute()).getJPAColumnName() : ((AbstractAttribute) metadata.getIdAttribute())
                        .getJPAColumnName();
            }
            return joinColumn;
        }
        return null;
    }
866915
public static RelationMetadataProcessor getRelationMetadataProcessor(Field relationField, KunderaMetadata kunderaMetadata)
    {
        RelationMetadataProcessor relProcessor = null;

        // OneToOne
        if (relationField.isAnnotationPresent(OneToOne.class))
        {
            relProcessor = new OneToOneRelationMetadataProcessor(kunderaMetadata);
        }

        // OneToMany
        else if (relationField.isAnnotationPresent(OneToMany.class))
        {
            relProcessor = new OneToManyRelationMetadataProcessor(kunderaMetadata);

        }

        // ManyToOne
        else if (relationField.isAnnotationPresent(ManyToOne.class))
        {
            relProcessor = new ManyToOneRelationMetadataProcessor(kunderaMetadata);

        }

        // ManyToMany
        else if (relationField.isAnnotationPresent(ManyToMany.class))
        {
            relProcessor = new ManyToManyRelationMetadataProcessor(kunderaMetadata);

        }

        return relProcessor;

    }
823143
public function getLocalizedRelationField($fieldName, $locale)
    {
        $baseName = $this->getBasename($fieldName);
        $localizedFieldName = self::localized_field($fieldName, $locale);

        $field = null;

        if ($field = $this->getFieldForRelation($fieldName)) {
            $relationField = clone $field;
            $relationField->setName($localizedFieldName);
            return $relationField;
        }

    }
1041338
protected function getParentsHierarchyField() {
		// see if we've got Parent values
        $parents = array();

        $parent = $this->owner;
        while ($parent && $parent->ParentID) {
            $parents[] = (int) $parent->ParentID;
            $parent = $parent->Parent();
            // fix for odd behaviour - in some instance a node is being assigned as its own parent. 
            if ($parent->ParentID == $parent->ID) {
                $parent = null;
            }
        }
        return $parents;
	}
1226945
public Iterable<DContact> queryByPrimaryCustomIndex(Object parent, java.lang.String primaryCustomIndex) {
    return queryByField(parent, DContactMapper.Field.PRIMARYCUSTOMINDEX.getFieldName(), primaryCustomIndex);
  }
791941
public Field getRelationshipMetaField(Class<?> clazz, String relationshipName) {
		return relationshipMetaFieldMap.get(clazz).get(relationshipName);
	}
1326364
public List<Entity> run(String parentKeyName) {
    Datastore datastore = transaction.getDatastore();
    // [START run]
    KeyFactory keyFactory = datastore.newKeyFactory().setKind("ParentKind");
    Key parentKey = keyFactory.newKey(parentKeyName);
    // Build a query
    Query<Entity> query =
        Query.newEntityQueryBuilder()
            .setKind("MyKind")
            .setFilter(PropertyFilter.hasAncestor(parentKey))
            .build();
    QueryResults<Entity> results = transaction.run(query);
    List<Entity> entities = Lists.newArrayList();
    while (results.hasNext()) {
      Entity result = results.next();
      // do something with result
      entities.add(result);
    }
    transaction.commit();
    // [END run]
    return entities;
  }
1094385
public function getFieldDefinition(Schema $schema, ObjectType $parentType, string $fieldName): ?Field
    {
        if ($fieldName === '__schema' && $schema->getQueryType() === $parentType) {
            return SchemaMetaFieldDefinition();
        }

        if ($fieldName === '__type' && $schema->getQueryType() === $parentType) {
            return TypeMetaFieldDefinition();
        }

        if ($fieldName === '__typename') {
            return TypeNameMetaFieldDefinition();
        }

        $fields = $parentType->getFields();

        return $fields[$fieldName] ?? null;
    }
869171
public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException {
		
		Field field = null;
		for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) {
			try {
				field = acls.getDeclaredField(fieldName);
				break;
			} catch (NoSuchFieldException e) {
				// ignore
			}
		}
		if (field == null) {
			throw new NoSuchFieldException("Could not find field '" + fieldName + "' in class '" + clazz.getName() + "' or its super classes");
		}
		
		return field;
	}
716812
public Iterable<DContact> queryBySecondaryCustomIndex(Object parent, java.lang.String secondaryCustomIndex) {
    return queryByField(parent, DContactMapper.Field.SECONDARYCUSTOMINDEX.getFieldName(), secondaryCustomIndex);
  }
1147186
public Field getRelationshipField(Class<?> clazz, String fieldName) {
		return relationshipFieldMap.get(clazz).get(fieldName);
	}
951511
public <U extends ODataEntity<?>> LinkInfo<U> getRelationLink(
            String relationName) {
        return this.<U> getLink(Constants.ODATA_DATA_NS + "/related/"
                + relationName);
    }
1095728
def relation_column(instance, fields):
    '''
    
    '''
    relation = getattr(instance.__class__, fields[0]).property
    _field = getattr(instance, fields[0])
    if relation.lazy == 'dynamic':
        _field = _field.first()
    return getattr(_field, fields[1]) if _field else ''
344925
private static Field findFieldInHierarchy(Object object, String fieldName) {
        return findFieldInHierarchy(object, new FieldNameMatcherStrategy(fieldName));
    }