Tabnine Logo
Criteria.setFlushMode
Code IndexAdd Tabnine 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)

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

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now