Package org.hibernate

Examples of org.hibernate.FlushMode


      throwPersistenceException( he );
    }
  }

  public FlushModeType getFlushMode() {
    FlushMode mode = getSession().getFlushMode();
    if ( mode == FlushMode.AUTO ) {
      this.flushModeType = FlushModeType.AUTO;
    }
    else if ( mode == FlushMode.COMMIT ) {
      this.flushModeType = FlushModeType.COMMIT;
View Full Code Here


   * JPA 2.0. This method can then return null.
   * If it returns null, do em.unwrap(Session.class).getFlushMode() to get the
   * Hibernate flush mode
   */
  public FlushModeType getFlushMode() {
    FlushMode mode = getSession().getFlushMode();
    if ( mode == FlushMode.AUTO ) {
      return FlushModeType.AUTO;
    }
    else if ( mode == FlushMode.COMMIT ) {
      return FlushModeType.COMMIT;
View Full Code Here

                    query.setString("principalName", prpal.getName());
                }
                query.setString("permissionClass", perm.getClass().getName());
                query.setString("permissionResource", perm.getName());
                query.setCacheable(true);
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.NEVER);
                results.addAll(query.list());
                session.setFlushMode(oldFlushMode);
            }
        };
View Full Code Here

            if (!StringUtils.isBlank(resourceName)) {
                query.setString("res1", resourceName);
                query.setString("res2", resourceName + ".*");
            }
            query.setCacheable(true);
            FlushMode oldFlushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.NEVER);
            results.addAll(query.list());
            session.setFlushMode(oldFlushMode);
        }}.execute();
        return results;
View Full Code Here

                Query query = session.createQuery(buf.toString());
                query.setString("permissionClass", permissionClass);
                query.setString("permissionResource", permissionResource);
                if (!includeReadOnly) query.setBoolean("readonly", includeReadOnly);
                query.setCacheable(true);
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.NEVER);
                results.addAll(query.list());
                session.setFlushMode(oldFlushMode);
            }
        };
View Full Code Here

            new HibernateTxFragment() {
                protected void txFragment(Session session) throws Exception {
                    String sql = new String(" from " + PermissionDescriptor.class.getName() + " as item where item.dbid = :dbid");
                    Query query = session.createQuery(sql);
                    query.setLong("dbid", idPermission);
                    FlushMode oldFlushMode = session.getFlushMode();
                    session.setFlushMode(FlushMode.NEVER);
                    result.add( (PermissionDescriptor) query.uniqueResult() );
                    session.setFlushMode(oldFlushMode);
                }
            }.execute();
View Full Code Here

            }
            idString.append(")");
            HibernateTxFragment txFragment = new HibernateTxFragment() {
                protected void txFragment(Session session) throws Exception {
                    Query query = session.createQuery(idString.toString());
                    FlushMode oldFlushMode = session.getFlushMode();
                    session.setFlushMode(FlushMode.NEVER);
                    results.addAll(query.list());
                    session.setFlushMode(oldFlushMode);
                }
            };
View Full Code Here

   * JPA 2.0. This method can then return null.
   * If it returns null, do em.unwrap(Session.class).getFlushMode() to get the
   * Hibernate flush mode
   */
  public FlushModeType getFlushMode() {
    FlushMode mode = getSession().getFlushMode();
    if ( mode == FlushMode.AUTO ) {
      return FlushModeType.AUTO;
    }
    else if ( mode == FlushMode.COMMIT ) {
      return FlushModeType.COMMIT;
View Full Code Here

        new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Query query = session.createQuery(" from " + DataSourceTableEntry.class.getName() + " entry where entry.datasource = :datasource");
                query.setString("datasource", datasource);
                query.setCacheable(true);
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.COMMIT);
                existingEntries.addAll(query.list());
                session.setFlushMode(oldFlushMode);
            }
        }.execute();
View Full Code Here

        new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Query query = session.createQuery(" from " + DataSourceColumnEntry.class.getName() + " entry where entry.datasource = :datasource and entry.tableName = :tableName");
                query.setString("datasource", datasource);
                query.setString("tableName", tableName);
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.NEVER);
                query.setCacheable(true);
                existingEntries.addAll(query.list());
                session.setFlushMode(oldFlushMode);
            }
View Full Code Here

TOP

Related Classes of org.hibernate.FlushMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.