javax.persistence.criteria.Fetch.getFetches()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中javax.persistence.criteria.Fetch.getFetches()方法的一些代码示例,展示了Fetch.getFetches()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fetch.getFetches()方法的具体详情如下:
包路径:javax.persistence.criteria.Fetch
类名称:Fetch
方法名:getFetches

Fetch.getFetches介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@SuppressWarnings({ "unchecked" })
  private void renderFetches(
      StringBuilder jpaqlQuery,
      RenderingContext renderingContext,
      Collection<Fetch> fetches) {
    if ( fetches == null ) {
      return;
    }

    for ( Fetch fetch : fetches ) {
      ( (FromImplementor) fetch ).prepareAlias( renderingContext );
      jpaqlQuery.append( renderJoinType( fetch.getJoinType() ) )
          .append( "fetch " )
          .append( ( (FromImplementor) fetch ).renderTableExpression( renderingContext ) );

      renderFetches( jpaqlQuery, renderingContext, fetch.getFetches() );
    }
  }
}

代码示例来源:origin: org.omnifaces/omnipersistence

@Override
public Set<Fetch<X, ?>> getFetches() {
  return getWrapped().getFetches();
}

代码示例来源:origin: br.eti.clairton/repository

@SuppressWarnings("unchecked")
  protected void fetchToJoin(final From<?, ?> from, final Set<Fetch<?, ?>> fetches) {
    if (fetches != null && !fetches.isEmpty()) {
      for (final Fetch<?, ?> fetch : fetches) {
        @SuppressWarnings("rawtypes")
        final Join join = (Join) fetch;
        final Set<Fetch<?, ?>> fs = (Set<Fetch<?, ?>>) ((Set<?>) fetch.getFetches());
        if (fs.isEmpty()) {
          try {
            from.getJoins().add(join);
          } catch (UnsupportedOperationException e) {
          }
        } else {
          fetchToJoin(join, fs);
        }
      }
      from.getFetches().clear();
    }
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb

@SuppressWarnings({ "unchecked" })
  private void renderFetches(
      StringBuilder jpaqlQuery,
      CriteriaQueryCompiler.RenderingContext renderingContext,
      Collection<Fetch> fetches) {
    if ( fetches == null ) {
      return;
    }

    for ( Fetch fetch : fetches ) {
      ( (FromImplementor) fetch ).prepareAlias( renderingContext );
      jpaqlQuery.append( renderJoinType( fetch.getJoinType() ) )
          .append( "fetch " )
          .append( ( (FromImplementor) fetch ).renderTableExpression( renderingContext ) );

      renderFetches( jpaqlQuery, renderingContext, fetch.getFetches() );
    }
  }
}

代码示例来源:origin: katharsis-project/katharsis-framework

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

代码示例来源:origin: katharsis-project/katharsis-framework

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

代码示例来源:origin: org.jboss.pressgang.ccms/pressgang-ccms-query

/**
   * Copy Fetches
   *
   * @param from source Fetch
   * @param to   dest Fetch
   */
  public static void copyFetches(Fetch<?, ?> from, Fetch<?, ?> to) {
    for (Fetch<?, ?> f : from.getFetches()) {
      Fetch<?, ?> toFetch = to.fetch(f.getAttribute().getName());
      // recursively copy fetches
      copyFetches(f, toFetch);
    }
  }
}

相关文章

微信公众号

最新文章

更多