本文整理汇总了Java中org.hibernate.loader.criteria.CriteriaLoader类的典型用法代码示例。如果您正苦于以下问题:Java CriteriaLoader类的具体用法?Java CriteriaLoader怎么用?Java CriteriaLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CriteriaLoader类属于org.hibernate.loader.criteria包,在下文中一共展示了CriteriaLoader类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scroll
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
@Override
public ScrollableResults scroll(Criteria criteria, ScrollMode scrollMode) {
// TODO: Is this guaranteed to always be CriteriaImpl?
CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
errorIfClosed();
checkTransactionSynchStatus();
String entityName = criteriaImpl.getEntityOrClassName();
CriteriaLoader loader = new CriteriaLoader(
getOuterJoinLoadable(entityName),
factory,
criteriaImpl,
entityName,
getLoadQueryInfluencers()
);
autoFlushIfRequired( loader.getQuerySpaces() );
dontFlushFromFind++;
try {
return loader.scroll(this, scrollMode);
}
finally {
delayedAfterCompletion();
dontFlushFromFind--;
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:SessionImpl.java
示例2: scroll
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
@Override
public ScrollableResults scroll(Criteria criteria, ScrollMode scrollMode) {
// TODO: Is this guaranteed to always be CriteriaImpl?
CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
errorIfClosed();
String entityName = criteriaImpl.getEntityOrClassName();
CriteriaLoader loader = new CriteriaLoader(
getOuterJoinLoadable( entityName ),
factory,
criteriaImpl,
entityName,
getLoadQueryInfluencers()
);
return loader.scroll(this, scrollMode);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:StatelessSessionImpl.java
示例3: showSql
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
public static String showSql(Criteria criteria){
try {
CriteriaImpl c = (CriteriaImpl) criteria;
SessionImpl s = (SessionImpl) c.getSession();
SessionFactoryImplementor factory = (SessionFactoryImplementor) s.getSessionFactory();
String[] implementors = factory.getImplementors(c.getEntityOrClassName());
LoadQueryInfluencers lqis = new LoadQueryInfluencers();
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable) factory.getEntityPersister(implementors[0]), factory, c, implementors[0], lqis);
Field f = OuterJoinLoader.class.getDeclaredField("sql");
f.setAccessible(true);
return (String) f.get(loader);
}catch (Exception e){
e.printStackTrace();
return "";
}
}
开发者ID:Letowski,项目名称:hibernate-filter,代码行数:17,代码来源:TableFilter.java
示例4: scroll
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode) {
errorIfClosed();
checkTransactionSynchStatus();
String entityName = criteria.getEntityOrClassName();
CriteriaLoader loader = new CriteriaLoader(
getOuterJoinLoadable(entityName),
factory,
criteria,
entityName,
getEnabledFilters()
);
autoFlushIfRequired( loader.getQuerySpaces() );
dontFlushFromFind++;
try {
return loader.scroll(this, scrollMode);
}
finally {
dontFlushFromFind--;
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:21,代码来源:SessionImpl.java
示例5: list
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public List list(Criteria criteria) throws HibernateException {
// TODO: Is this guaranteed to always be CriteriaImpl?
CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
errorIfClosed();
String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
int size = implementors.length;
CriteriaLoader[] loaders = new CriteriaLoader[size];
for( int i=0; i <size; i++ ) {
loaders[i] = new CriteriaLoader(
getOuterJoinLoadable( implementors[i] ),
factory,
criteriaImpl,
implementors[i],
getLoadQueryInfluencers()
);
}
List results = Collections.EMPTY_LIST;
boolean success = false;
try {
for( int i=0; i<size; i++ ) {
final List currentResults = loaders[i].list(this);
currentResults.addAll(results);
results = currentResults;
}
success = true;
}
finally {
afterOperation(success);
}
temporaryPersistenceContext.clear();
return results;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:StatelessSessionImpl.java
示例6: scroll
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode) {
errorIfClosed();
String entityName = criteria.getEntityOrClassName();
CriteriaLoader loader = new CriteriaLoader(
getOuterJoinLoadable(entityName),
factory,
criteria,
entityName,
getEnabledFilters()
);
return loader.scroll(this, scrollMode);
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:StatelessSessionImpl.java
示例7: list
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
public List list(CriteriaImpl criteria) throws HibernateException {
errorIfClosed();
String[] implementors = factory.getImplementors( criteria.getEntityOrClassName() );
int size = implementors.length;
CriteriaLoader[] loaders = new CriteriaLoader[size];
for( int i=0; i <size; i++ ) {
loaders[i] = new CriteriaLoader(
getOuterJoinLoadable( implementors[i] ),
factory,
criteria,
implementors[i],
getEnabledFilters()
);
}
List results = Collections.EMPTY_LIST;
boolean success = false;
try {
for( int i=0; i<size; i++ ) {
final List currentResults = loaders[i].list(this);
currentResults.addAll(results);
results = currentResults;
}
success = true;
}
finally {
afterOperation(success);
}
temporaryPersistenceContext.clear();
return results;
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:34,代码来源:StatelessSessionImpl.java
示例8: list
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
@Override
public List list(Criteria criteria) throws HibernateException {
// TODO: Is this guaranteed to always be CriteriaImpl?
CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
if ( naturalIdLoadAccess != null ) {
// EARLY EXIT!
return Arrays.asList( naturalIdLoadAccess.load() );
}
errorIfClosed();
checkTransactionSynchStatus();
String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
int size = implementors.length;
CriteriaLoader[] loaders = new CriteriaLoader[size];
Set spaces = new HashSet();
for( int i=0; i <size; i++ ) {
loaders[i] = new CriteriaLoader(
getOuterJoinLoadable( implementors[i] ),
factory,
criteriaImpl,
implementors[i],
getLoadQueryInfluencers()
);
spaces.addAll( loaders[i].getQuerySpaces() );
}
autoFlushIfRequired(spaces);
List results = Collections.EMPTY_LIST;
dontFlushFromFind++;
boolean success = false;
try {
for( int i=0; i<size; i++ ) {
final List currentResults = loaders[i].list(this);
currentResults.addAll(results);
results = currentResults;
}
success = true;
}
finally {
dontFlushFromFind--;
afterOperation(success);
delayedAfterCompletion();
}
return results;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:54,代码来源:SessionImpl.java
示例9: list
import org.hibernate.loader.criteria.CriteriaLoader; //导入依赖的package包/类
public List list(CriteriaImpl criteria) throws HibernateException {
errorIfClosed();
checkTransactionSynchStatus();
String[] implementors = factory.getImplementors( criteria.getEntityOrClassName() );
int size = implementors.length;
CriteriaLoader[] loaders = new CriteriaLoader[size];
Set spaces = new HashSet();
for( int i=0; i <size; i++ ) {
loaders[i] = new CriteriaLoader(
getOuterJoinLoadable( implementors[i] ),
factory,
criteria,
implementors[i],
getEnabledFilters()
);
spaces.addAll( loaders[i].getQuerySpaces() );
}
autoFlushIfRequired(spaces);
List results = Collections.EMPTY_LIST;
dontFlushFromFind++;
boolean success = false;
try {
for( int i=0; i<size; i++ ) {
final List currentResults = loaders[i].list(this);
currentResults.addAll(results);
results = currentResults;
}
success = true;
}
finally {
dontFlushFromFind--;
afterOperation(success);
}
return results;
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:43,代码来源:SessionImpl.java
注:本文中的org.hibernate.loader.criteria.CriteriaLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论