本文整理了Java中org.hibernate.query.Query.setFlushMode
方法的一些代码示例,展示了Query.setFlushMode
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setFlushMode
方法的具体详情如下:
包路径:org.hibernate.query.Query
类名称:Query
方法名:setFlushMode
英set the current FlushMode in effect for this query.
[中](重新)为此查询设置有效的当前刷新模式。
代码示例来源:origin: hibernate/hibernate-orm
protected void setQueryProperties(Query query) {
if ( maxResults != null ) {
query.setMaxResults( maxResults );
}
if ( firstResult != null ) {
query.setFirstResult( firstResult );
}
if ( cacheable != null ) {
query.setCacheable( cacheable );
}
if ( cacheRegion != null ) {
query.setCacheRegion( cacheRegion );
}
if ( comment != null ) {
query.setComment( comment );
}
if ( flushMode != null ) {
query.setFlushMode( flushMode );
}
if ( cacheMode != null ) {
query.setCacheMode( cacheMode );
}
if ( timeout != null ) {
query.setTimeout( timeout );
}
if ( lockOptions != null && lockOptions.getLockMode() != LockMode.NONE ) {
query.setLockMode( REFERENCED_ENTITY_ALIAS, lockOptions.getLockMode() );
}
}
代码示例来源:origin: org.nuiton.topia/topia-persistence
protected Query prepareQuery(String jpaql, Map<String, Object> parameters) {
checkHqlParameters(parameters);
Query query = hibernateSupport.getHibernateSession().createQuery(jpaql);
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
if (value.getClass().isArray()) {
query.setParameterList(name, (Object[]) value);
} else if (value instanceof Collection<?>) {
query.setParameterList(name, (Collection<?>) value);
} else {
query.setParameter(name, value);
}
}
// tchemit 2010-11-30 reproduce the same behaviour than before with the dao legacy
if (useFlushMode) { // FIXME AThimel 06/08/14 I think this is the reason of the unexpected flush we have
query.setFlushMode(FlushMode.AUTO);
}
return query;
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
query.setFlushMode( flushModeType );
内容来源于网络,如有侵权,请联系作者删除!