当前位置: 首页>>代码示例>>Java>>正文


Java Attribute.isAssociation方法代码示例

本文整理汇总了Java中javax.persistence.metamodel.Attribute.isAssociation方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.isAssociation方法的具体用法?Java Attribute.isAssociation怎么用?Java Attribute.isAssociation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.persistence.metamodel.Attribute的用法示例。


在下文中一共展示了Attribute.isAssociation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: containsMultiRelationFetch

import javax.persistence.metamodel.Attribute; //导入方法依赖的package包/类
private static boolean containsMultiRelationFetch(Set<?> fetches) {
	for (Object fetchObj : fetches) {
		Fetch<?, ?> fetch = (Fetch<?, ?>) fetchObj;

		Attribute<?, ?> attr = fetch.getAttribute();
		if (attr.isAssociation() && attr.isCollection())
			return true;

		if (containsMultiRelationFetch(fetch.getFetches()))
			return true;
	}
	return false;
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:14,代码来源:QueryUtil.java

示例2: containsMultiRelationJoin

import javax.persistence.metamodel.Attribute; //导入方法依赖的package包/类
private static boolean containsMultiRelationJoin(Set<?> fetches) {
	for (Object fetchObj : fetches) {
		Fetch<?, ?> fetch = (Fetch<?, ?>) fetchObj;
		Attribute<?, ?> attr = fetch.getAttribute();
		if (attr.isAssociation() && attr.isCollection())
			return true;

		if (containsMultiRelationFetch(fetch.getFetches()))
			return true;
	}
	return false;
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:13,代码来源:QueryUtil.java

示例3: containsMultiRelationFetch

import javax.persistence.metamodel.Attribute; //导入方法依赖的package包/类
private static boolean containsMultiRelationFetch(Set<?> fetches) {
  for (Object fetchObj : fetches) {
    Fetch<?, ?> fetch = (Fetch<?, ?>) fetchObj;

    Attribute<?, ?> attr = fetch.getAttribute();
    if (attr.isAssociation() && attr.isCollection())
      return true;

    if (containsMultiRelationFetch(fetch.getFetches()))
      return true;
  }
  return false;
}
 
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:14,代码来源:QueryUtil.java

示例4: containsMultiRelationJoin

import javax.persistence.metamodel.Attribute; //导入方法依赖的package包/类
private static boolean containsMultiRelationJoin(Set<?> fetches) {
  for (Object fetchObj : fetches) {
    Fetch<?, ?> fetch = (Fetch<?, ?>) fetchObj;
    Attribute<?, ?> attr = fetch.getAttribute();
    if (attr.isAssociation() && attr.isCollection())
      return true;

    if (containsMultiRelationFetch(fetch.getFetches()))
      return true;
  }
  return false;
}
 
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:13,代码来源:QueryUtil.java

示例5: resolveReference

import javax.persistence.metamodel.Attribute; //导入方法依赖的package包/类
private void resolveReference(final Object entity, Attribute<?, ?> attribute) {
     if (attribute.isCollection() && !Map.class.isAssignableFrom(attribute.getJavaType())) {
        // Properties that are collections of other entities
        final Collection<?> current = PropertyHelper.get(entity, attribute.getName());
        if (current != null) {
            boolean isEntityCollection = true;
            final Collection<Entity> resolved = ClassHelper.instantiate(current.getClass());
            for (final Object object : current) {
                if (object != null && !(object instanceof Entity)) {
                    isEntityCollection = false;
                    break;
                }
                Entity e = (Entity) object;
                if (object instanceof EntityReference) {
                    e = entityManager.find(EntityHelper.getRealClass(e), e.getId());
                }
                resolved.add(e);
            }
            if (isEntityCollection) {
                PropertyHelper.set(entity, attribute.getName(), resolved);
            }
        }
    } else if (attribute.isAssociation() && !Map.class.isAssignableFrom(attribute.getJavaType())) {
        // Properties that are relationships to other entities
        Entity rel = PropertyHelper.get(entity, attribute.getName());
        if (rel instanceof EntityReference) {
            rel = entityManager.find(EntityHelper.getRealClass(rel), rel.getId());
            PropertyHelper.set(entity, attribute.getName(), rel);
        }
    }
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:32,代码来源:JpaQueryHandler.java


注:本文中的javax.persistence.metamodel.Attribute.isAssociation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。