本文整理了Java中org.hibernate.query.Query.applyFetchGraph
方法的一些代码示例,展示了Query.applyFetchGraph
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.applyFetchGraph
方法的具体详情如下:
包路径:org.hibernate.query.Query
类名称:Query
方法名:applyFetchGraph
[英]Apply the given graph using GraphSemantic#FETCH
[中]使用GraphSemantic#FETCH应用给定的图形
代码示例来源:origin: hibernate/hibernate-orm
/**
* Convenience method for {@linkplain Query#getResultList() executing} the Query using the
* given EntityGraph
*
* @param query The JPA Query
* @param graph The graph to apply
*
* @apiNote operates on the assumption that the "default" semantic for an
* entity graph applied to a Query is {@link GraphSemantic#FETCH}. This is simply
* knowledge from JPA EG discussions, nothing that is specifically mentioned or
* discussed in the spec.
*/
@SuppressWarnings({"unused", "unchecked"})
public static List executeList(Query query, EntityGraph graph) {
return query.unwrap( org.hibernate.query.Query.class )
.applyFetchGraph( (RootGraph) graph )
.list();
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
/**
* Convenience method for {@linkplain Query#getResultList() executing} the Query using the
* given EntityGraph
*
* @param query The JPA Query
* @param graph The graph to apply
*
* @apiNote operates on the assumption that the "default" semantic for an
* entity graph applied to a Query is {@link GraphSemantic#FETCH}. This is simply
* knowledge from JPA EG discussions, nothing that is specifically mentioned or
* discussed in the spec.
*/
@SuppressWarnings({"unused", "unchecked"})
public static List executeList(Query query, EntityGraph graph) {
return query.unwrap( org.hibernate.query.Query.class )
.applyFetchGraph( (RootGraph) graph )
.list();
}
内容来源于网络,如有侵权,请联系作者删除!