Examples of FlushMode


Examples of org.hibernate.FlushMode

    public Workspace getWorkspaceByUrl(final String url) throws Exception {
        final Workspace[] workspace = new Workspace[1];
        new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.NEVER);
                Query q = session.createQuery(" from " + WorkspaceImpl.class.getName() + " p where p.friendlyUrl = :url");
                q.setString("url", url);
                q.setCacheable(true);
                List l = q.list();
View Full Code Here

Examples of org.hibernate.FlushMode

    public Panel getPaneltByDbId(final Long panelId) throws Exception {
        final List results = new ArrayList();
        new HibernateTxFragment() {
        protected void txFragment(Session session) throws Exception {
            FlushMode flushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.COMMIT);

            StringBuffer sql = new StringBuffer();
            sql.append("select p ");
            sql.append("from ").append(Panel.class.getName()).append(" as p ");
View Full Code Here

Examples of org.hibernate.FlushMode

    public Panel getPaneltById(final Long panelId) throws Exception {
        final List results = new ArrayList();
        new HibernateTxFragment() {
        protected void txFragment(Session session) throws Exception {
            FlushMode flushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.COMMIT);

            StringBuffer sql = new StringBuffer();
            sql.append("select p ");
            sql.append("from ").append(Panel.class.getName()).append(" as p ");
View Full Code Here

Examples of org.hibernate.FlushMode

    public Set<PanelInstance> getPanelsByParameter(final String paramId, final String value) throws Exception {
        final Set<PanelInstance> results = new HashSet<PanelInstance>();
        new HibernateTxFragment() {
        protected void txFragment(Session session) throws Exception {
            FlushMode flushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.COMMIT);

            StringBuffer sql = new StringBuffer();
            sql.append("select p ");
            sql.append("from ").append(PanelInstance.class.getName()).append(" as p join p.panelParams as param ");
View Full Code Here

Examples of org.hibernate.FlushMode

    if ( queryAnn == null ) return;
    if ( BinderHelper.isDefault( queryAnn.name() ) ) {
      throw new AnnotationException( "A named query must have a name when used in class or package level" );
    }

    FlushMode flushMode;
    flushMode = getFlushMode( queryAnn.flushMode() );

    NamedQueryDefinition query = new NamedQueryDefinition(
        queryAnn.query(),
        queryAnn.cacheable(),
View Full Code Here

Examples of org.hibernate.FlushMode

    mappings.addQuery( queryAnn.name(), query );
    if ( log.isInfoEnabled() ) log.info( "Binding named query: " + queryAnn.name() + " => " + queryAnn.query() );
  }

  private static FlushMode getFlushMode(FlushModeType flushModeType) {
    FlushMode flushMode;
    switch ( flushModeType ) {
      case ALWAYS:
        flushMode = FlushMode.ALWAYS;
        break;
      case AUTO:
View Full Code Here

Examples of org.hibernate.FlushMode

  public static void bindQuery(org.hibernate.annotations.NamedQuery queryAnn, Mappings mappings) {
    if ( queryAnn == null ) return;
    if ( BinderHelper.isEmptyAnnotationValue( queryAnn.name() ) ) {
      throw new AnnotationException( "A named query must have a name when used in class or package level" );
    }
    FlushMode flushMode;
    flushMode = getFlushMode( queryAnn.flushMode() );

    NamedQueryDefinition query = new NamedQueryDefinition(
        queryAnn.name(),
        queryAnn.query(),
View Full Code Here

Examples of org.hibernate.FlushMode

      LOG.debugf( "Binding named query: %s => %s", query.getName(), query.getQueryString() );
    }
  }

  private static FlushMode getFlushMode(FlushModeType flushModeType) {
    FlushMode flushMode;
    switch ( flushModeType ) {
      case ALWAYS:
        flushMode = FlushMode.ALWAYS;
        break;
      case AUTO:
View Full Code Here

Examples of org.hibernate.FlushMode

        final List result = new ArrayList();
        try {
            new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Query query = session.createQuery(" from " + DataSourceEntry.class.getName());
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.COMMIT);
                query.setCacheable(true);
                result.addAll(query.list());
                session.setFlushMode(oldFlushMode);
            }}.execute();
View Full Code Here

Examples of org.hibernate.FlushMode

        if (name == null) return null;

        final List results = new ArrayList();
        new HibernateTxFragment() {
        protected void txFragment(Session session) throws Exception {
            FlushMode flushMode = session.getFlushMode();
            session.setFlushMode(FlushMode.COMMIT);

            StringBuffer sql = new StringBuffer();
            sql.append("select dse ");
            sql.append("from ").append(DataSourceEntry.class.getName()).append(" as dse ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.