congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SessionImpl.afterOperation
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: hibernate/hibernate

public Object get(String entityName, Serializable id) throws HibernateException {
  LoadEvent event = new LoadEvent(id, entityName, false, this);
  boolean success = false;
  try {
    Object result = listeners.getLoadEventListener().onLoad(event, LoadEventListener.GET);
    success = true;
    return result;
  }
  finally {
    afterOperation(success);
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Object get(String entityName, Serializable id) throws HibernateException {
  LoadEvent event = new LoadEvent(id, entityName, false, this);
  boolean success = false;
  try {
    fireLoad(event, LoadEventListener.GET);
    success = true;
    return event.getResult();
  }
  finally {
    afterOperation(success);
  }
}
origin: hibernate/hibernate

public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException {
  if ( log.isTraceEnabled() ) {
    log.trace( "executeUpdate: " + query );
    queryParameters.traceParameters(factory);
  }
  queryParameters.validateParameters();
  QueryTranslator[] queryTranslators = getQueries(query, false);
  
  int result = 0;
  boolean success = false;
  try {
    for (int i=0; i<queryTranslators.length; i++) {
      result += queryTranslators[i].executeUpdate( queryParameters, this );
    }
    success = true;
  }
  finally {
    afterOperation(success);
  }
  return result;
}
origin: hibernate/hibernate

public List list(String query, QueryParameters queryParameters) throws HibernateException {
  if ( log.isTraceEnabled() ) {
    log.trace( "find: " + query );
    queryParameters.traceParameters(factory);
  }
  queryParameters.validateParameters();
  QueryTranslator[] q = getQueries(query, false);
  List results = CollectionHelper.EMPTY_LIST;
  dontFlushFromFind++;   //stops flush being called multiple times if this method is recursively called
  //execute the queries and return all result lists as a single list
  boolean success = false;
  try {
    for ( int i = 0; i < q.length; i++ ) {
      List currentResults = q[i].list(this, queryParameters);
      currentResults.addAll(results);
      results = currentResults;
    }
    success = true;
  }
  finally {
    dontFlushFromFind--;
    afterOperation(success);
  }
  return results;
}
origin: hibernate/hibernate

public List listFilter(Object collection, String filter, QueryParameters queryParameters) 
throws HibernateException {
  String[] concreteFilters = QuerySplitter.concreteQueries( filter, factory );
  FilterTranslator[] filters = new FilterTranslator[concreteFilters.length];
  for ( int i = 0; i < concreteFilters.length; i++ ) {
    filters[i] = getFilterTranslator( collection, concreteFilters[i], queryParameters, false );
  }
  dontFlushFromFind++;   //stops flush being called multiple times if this method is recursively called
  List results = CollectionHelper.EMPTY_LIST;
  boolean success = false;
  try {
    for ( int i = 0; i < concreteFilters.length; i++ ) {
      List currentResults = filters[i].list( this, queryParameters );
      currentResults.addAll(results);
      results = currentResults;
    }
    success = true;
  }
  finally {
    dontFlushFromFind--;
    afterOperation(success);
  }
  return results;
}
origin: hibernate/hibernate

public Object load(String entityName, Serializable id) throws HibernateException {
  LoadEvent event = new LoadEvent(id, entityName, false, this);
  boolean success = false;
  try {
    Object result = listeners.getLoadEventListener().onLoad(event, LoadEventListener.LOAD);
    ObjectNotFoundException.throwIfNull(result, id, entityName);
    success = true;
    return result;
  }
  finally {
    afterOperation(success);
  }
}
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 List listFilter(Object collection, String filter, QueryParameters queryParameters) 
throws HibernateException {
  errorIfClosed();
  checkTransactionSynchStatus();
  FilterQueryPlan plan = getFilterQueryPlan( collection, filter, queryParameters, false );
  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: hibernate/hibernate

afterOperation(success);
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Object load(String entityName, Serializable id) throws HibernateException {
  LoadEvent event = new LoadEvent(id, entityName, false, this);
  boolean success = false;
  try {
    fireLoad( event, LoadEventListener.LOAD );
    if ( event.getResult() == null ) {
      getFactory().getEntityNotFoundDelegate().handleEntityNotFound( entityName, id );
    }
    success = true;
    return event.getResult();
  }
  finally {
    afterOperation(success);
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

afterOperation(success);
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;
}
org.hibernate.implSessionImplafterOperation

Javadoc

Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processing

Popular methods of SessionImpl

  • getFactory
  • <init>
    Constructor used in building "child sessions".
  • autoFlushIfRequired
    detect in-memory changes, determine if the changes are to tables named in the query and, if so, comp
  • 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

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JList (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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