~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to clc/modules/msgs/src/main/java/com/eucalyptus/util/EntityWrapper.java

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
      this.exceptionCaught( e );
104
104
      throw (RuntimeException) e ;
105
105
    }
106
 
    LOG.debug( EventRecord.here( Component.db, DbEvent.CREATE.end( ), Long.toString( tx.splitOperation() ), tx.getTxUuid( ) ) );
 
106
    LOG.trace( EventRecord.here( Component.db, DbEvent.CREATE.end( ), Long.toString( tx.splitOperation() ), tx.getTxUuid( ) ) );
107
107
  }
108
108
 
109
109
  @SuppressWarnings( "unchecked" )
110
110
  public List<TYPE> query( TYPE example ) {
111
111
    LOG.trace( EventRecord.here( Component.db, DbEvent.QUERY.begin( ), tx.getTxUuid( ) ) );
112
112
    Example qbe = Example.create( example ).enableLike( MatchMode.EXACT );
113
 
    List<TYPE> resultList = ( List<TYPE> ) this.getSession( ).createCriteria( example.getClass( ) ).add( qbe ).list( );
 
113
    List<TYPE> resultList = ( List<TYPE> ) this.getSession( ).createCriteria( example.getClass( ) ).setCacheable( true ).add( qbe ).list( );
114
114
    LOG.trace( EventRecord.here( Component.db, DbEvent.QUERY.end( ), Long.toString( tx.splitOperation( ) ), tx.getTxUuid( ) ) );
115
115
    return Lists.newArrayList( Sets.newHashSet( resultList ) );
116
116
  }
223
223
      return this.name( ) + ":END";
224
224
    }
225
225
    public String getMessage( ) {
226
 
      return EntityWrapper.getMyStackTraceElement( ).toString( );
 
226
      if( DebugUtil.TRACE ) {
 
227
        return EntityWrapper.getMyStackTraceElement( ).toString( );
 
228
      } else {
 
229
        return "n.a";
 
230
      }
227
231
    }
228
232
  }
229
233