Tabnine Logo
SessionImpl.autoFlushIfRequired
Code IndexAdd Tabnine to your IDE (free)

How to use
autoFlushIfRequired
method
in
org.hibernate.impl.SessionImpl

Best Java code snippets using org.hibernate.impl.SessionImpl.autoFlushIfRequired (Showing top 15 results out of 315)

origin: hibernate/hibernate

private QueryTranslator[] prepareQueries(QueryTranslator[] q) {
  HashSet qs = new HashSet();
  for ( int i = 0; i < q.length; i++ ) {
    qs.addAll( q[i].getQuerySpaces() );
  }
  autoFlushIfRequired(qs);
  return q;
}
origin: hibernate/hibernate

public ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) 
throws HibernateException {
  if ( log.isTraceEnabled() ) {
    log.trace( "scroll SQL query: " + customQuery.getSQL() );
  }
  CustomLoader loader = new CustomLoader( customQuery, getFactory() );
  autoFlushIfRequired( loader.getQuerySpaces() );
  dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
  try {
    return loader.scroll(queryParameters, this);
  }
  finally {
    dontFlushFromFind--;
  }
}
origin: hibernate/hibernate

public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException {
  if ( log.isTraceEnabled() ) {
    log.trace( "scroll: " + query );
    queryParameters.traceParameters( factory );
  }
  QueryTranslator[] q = factory.getQuery( query, false, getEnabledFilters() );
  if ( q.length != 1 ) throw new QueryException( "implicit polymorphism not supported for scroll() queries" );
  autoFlushIfRequired( q[0].getQuerySpaces() );
  dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
  try {
    return q[0].scroll(queryParameters, this);
  }
  finally {
    dontFlushFromFind--;
  }
}
origin: hibernate/hibernate

public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) 
throws HibernateException {
  if ( log.isTraceEnabled() ) log.trace( "SQL query: " + customQuery.getSQL() );
  
  CustomLoader loader = new CustomLoader( customQuery, getFactory() );
  autoFlushIfRequired( loader.getQuerySpaces() );
  dontFlushFromFind++;
  boolean success = false;
  try {
    List results = loader.list(this, queryParameters);
    success = true;
    return results;
  }
  finally {
    dontFlushFromFind--;
    afterOperation(success);
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  HQLQueryPlan plan = getHQLQueryPlan( query, false );
  autoFlushIfRequired( plan.getQuerySpaces() );
  dontFlushFromFind++;
  try {
    return plan.performScroll( queryParameters, this );
  }
  finally {
    dontFlushFromFind--;
  }
}
origin: hibernate/hibernate

autoFlushIfRequired(spaces);
origin: jboss.jboss-embeddable-ejb3/hibernate-all

autoFlushIfRequired(spaces);
origin: hibernate/hibernate

public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode) {
  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--;
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  queryParameters.validateParameters();
  HQLQueryPlan plan = getHQLQueryPlan( query, false );
  autoFlushIfRequired( plan.getQuerySpaces() );
  boolean success = false;
  int result = 0;
  try {
    result = plan.performExecuteUpdate( queryParameters, this );
    success = true;
  }
  finally {
    afterOperation(success);
  }
  return result;
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification,
    QueryParameters queryParameters) throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  queryParameters.validateParameters();
  NativeSQLQueryPlan plan = getNativeSQLQueryPlan(nativeQuerySpecification);
  
  autoFlushIfRequired( plan.getCustomQuery().getQuerySpaces() );
  
  boolean success = false;
  int result = 0;
  try {
    result = plan.performExecuteUpdate(queryParameters, this);
    success = true;
  } finally {
    afterOperation(success);
  }
  return result;
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public List list(String query, QueryParameters queryParameters) throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  queryParameters.validateParameters();
  HQLQueryPlan plan = getHQLQueryPlan( query, false );
  autoFlushIfRequired( plan.getQuerySpaces() );
  List results = CollectionHelper.EMPTY_LIST;
  boolean success = false;
  dontFlushFromFind++;   //stops flush being called multiple times if this method is recursively called
  try {
    results = plan.performList( queryParameters, this );
    success = true;
  }
  finally {
    dontFlushFromFind--;
    afterOperation(success);
  }
  return results;
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

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--;
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  queryParameters.validateParameters();
  HQLQueryPlan plan = getHQLQueryPlan( query, true );
  autoFlushIfRequired( plan.getQuerySpaces() );
  dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
  try {
    return plan.performIterate( queryParameters, this );
  }
  finally {
    dontFlushFromFind--;
  }
}
origin: hibernate/hibernate

if ( autoFlushIfRequired( filterTranslator.getQuerySpaces() ) ) {
origin: jboss.jboss-embeddable-ejb3/hibernate-all

if ( autoFlushIfRequired( plan.getQuerySpaces() ) ) {
org.hibernate.implSessionImplautoFlushIfRequired

Javadoc

detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush

Popular methods of SessionImpl

  • getFactory
  • <init>
    Constructor used in building "child sessions".
  • afterOperation
    Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessar
  • cleanup
    clear all the internal collections, just to help the garbage collector, does not clear anything that
  • clear
  • close
  • delete
  • find
    Retrieve a list of persistent objects using a hibernate query
  • flush
  • get
  • getConnectionReleaseMode
  • getEnabledFilters
  • getConnectionReleaseMode,
  • getEnabledFilters,
  • getFlushMode,
  • getOuterJoinLoadable,
  • getProxyIdentifier,
  • guessEntityName,
  • isAutoCloseSessionEnabled,
  • iterate,
  • list

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • Top plugins for Android Studio
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