Codota Logo
Criteria.setFlushMode
Code IndexAdd Codota to your IDE (free)

How to use
setFlushMode
method
in
org.hibernate.Criteria

Best Java code snippets using org.hibernate.Criteria.setFlushMode (Showing top 11 results out of 315)

  • Common ways to obtain Criteria
private void myMethod () {
Criteria c =
  • Codota IconSession session;Class persistentClass;session.createCriteria(persistentClass)
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

private Criteria getCriteria(Session s) {
  Criteria crit = s.createCriteria( A.class, "anAlias" );
  crit.add( Restrictions.naturalId().set( "name", "name1" ) );
  crit.setFlushMode( FlushMode.COMMIT );
  crit.setCacheable( true );
  return crit;
}
origin: TGAC/miso-lims

@Override
public Criteria setFlushMode(FlushMode flushMode) {
 backingCriteria.setFlushMode(flushMode);
 return this;
}
origin: ezbz/projectx

@Override
public Criteria setFlushMode(final FlushMode flushMode) {
 return criteria.setFlushMode(flushMode);
}
origin: com.pojosontheweb/woko-usermanagement-hibernate

@Override
@SuppressWarnings("unchecked")
public U getUserByUsername(String username) {
  Session s = hibernateStore.getSession();
  List l = s.createCriteria(getUserClass())
      .add(Restrictions.eq("username", username))
      .setFlushMode(FlushMode.MANUAL)
      .list();
  if (l.size()==0) {
    return null;
  }
  if (l.size()>1) {
    throw new IllegalStateException("more than 1 users with username==" + username);
  }
  return (U)l.get(0);
}
origin: com.pojosontheweb/woko-usermanagement-hibernate

@Override
@SuppressWarnings("unchecked")
public U getUserByEmail(String email) {
  Session s = hibernateStore.getSession();
  List l = s.createCriteria(getUserClass())
      .add(Restrictions.eq("email", email))
      .setFlushMode(FlushMode.MANUAL)
      .list();
  if (l.size()==0) {
    return null;
  }
  if (l.size()>1) {
    throw new IllegalStateException("more than 1 users with email==" + email);
  }
  return (U)l.get(0);
}
origin: at.chrl/chrl-orm

/**
 * crates a Stream with given {@link Criteria} crit
 * 
 * @param crit
 *            - given Criteria
 * @return new {@link Stream} with given ResultSet
 */
public <T> Stream<T> stream(Criteria crit) {
  if(TransactionStatus.NOT_ACTIVE.equals(session.getTransaction().getStatus()))
    session.beginTransaction();
  if (loggingEnabled)
    logQuery(false);
  
  return StreamSupport.<T> stream(Spliterators.spliteratorUnknownSize(
      new QueryIterator<T>(crit.setCacheMode(CacheMode.IGNORE)
          .setFlushMode(FlushMode.MANUAL), this, false),
      Spliterator.ORDERED | Spliterator.DISTINCT), false);
}
origin: hibernate/hibernate-search

.setLockMode( LockMode.NONE )
.setCacheable( false )
.setFlushMode( FlushMode.MANUAL )
.setFetchSize( listIds.size() )
.setResultTransformer( CriteriaSpecification.DISTINCT_ROOT_ENTITY )
origin: org.grails/grails-datastore-gorm-hibernate-core

c.setFlushMode(convertFlushMode(argMap.get(DynamicFinder.ARGUMENT_FLUSH_MODE)));
origin: org.grails/grails-hibernate

c.setFlushMode(converter.convertIfNecessary(argMap.get(ARGUMENT_FLUSH_MODE),FlushMode.class));
origin: hibernate/hibernate-search

.setLockMode( LockMode.NONE )
.setCacheable( false )
.setFlushMode( FlushMode.MANUAL )
.setFetchSize( listIds.size() )
.setResultTransformer( CriteriaSpecification.DISTINCT_ROOT_ENTITY )
origin: hibernate/hibernate-search

.setCacheable( false )
.setLockMode( LockMode.NONE )
.setFlushMode( FlushMode.MANUAL )
.setCacheMode( cacheMode )
.setFetchSize( entityFetchSize )
org.hibernateCriteriasetFlushMode

Javadoc

Override the flush mode for this particular query.

Popular methods of Criteria

  • list
    Get the results.
  • add
    Add a Criterion to constrain the results to be retrieved.
  • uniqueResult
    Convenience method to return a single instance that matches the query, or null if the query returns
  • addOrder
    Add an Order to the result set.
  • setProjection
    Used to specify that the query results will be a projection (scalar in nature). Implicitly specifies
  • setMaxResults
    Set a limit upon the number of objects to be retrieved.
  • setFirstResult
    Set the first result to be retrieved.
  • setResultTransformer
    Set a strategy for handling the query results. This determines the "shape" of the query result.
  • createAlias
    Join an association using the specified join-type, assigning an alias to the joined association. The
  • createCriteria
    Create a new Criteria, "rooted" at the associated entity, using the specified join type.
  • setFetchMode
    Specify an association fetching strategy for an association or a collection of values.
  • setCacheable
    Enable caching of this query result, provided query caching is enabled for the underlying session fa
  • setFetchMode,
  • setCacheable,
  • setFetchSize,
  • scroll,
  • setLockMode,
  • setReadOnly,
  • setCacheRegion,
  • setTimeout,
  • setCacheMode

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • ImageIO (javax.imageio)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now