butler.ext.cache
Class CachingTable

java.lang.Object
  extended by butler.util.BaseGroovyObjectSupport
      extended by butler.sql.metadata.Table
          extended by butler.ext.cache.CachingTable
All Implemented Interfaces:
groovy.lang.GroovyObject

public class CachingTable
extends Table

Table with caching functionality. When findByPK is called, the record is fetched from the cache if it is already read.

Author:
Fredrik Bertilsson

Field Summary
 
Fields inherited from class butler.sql.metadata.Table
_fks, _name, DUMMY
 
Constructor Summary
CachingTable(Table tab, int size)
           
CachingTable(Table tab, int size, MultipleColumnFilter filter)
           
 
Method Summary
 Record findByPK(butler.util.Tuple key)
          Returns the record with the given (multi-column) primary key.
 void save()
           
 
Methods inherited from class butler.sql.metadata.Table
addForeignKey, addIndex, addRecord, addRecordListener, addRelation, copy, create, createColumn, createColumn, createColumn, createColumn, createColumn, createColumn, createDeleteQuery, createQuery, createRecord, drop, equals, equals, exists, findAll, findByPK, findByPK0, findByPKIfExists, findByPKIfExists, getAuthorizator, getCaption, getColumn, getColumns, getDatabase, getDataColumns, getExportedForeignKeys, getForeignKey, getForeignKey, getForeignKeyNames, getForeignKeys, getImportedForeignKeys, getIndex, getIndexes, getLocalizedCaption, getLogicalColumns, getName, getPath, getPhysicalColumns, getPhysicalName, getPrimaryKeyColumns, getProperty, getQualifiedName, getQuery, getRecordComparator, getRecordListeners, getRelation, getSchema, getTable, getTable, getValidator, hashCode, invokeMethod, isDummy, load, loadAll, loadFKs, newRecord, registerColumn, registerQuery, setAuthorizator, setRecordComparator, setSchema, setValidator, toXML, unload, upgrade
 
Methods inherited from class butler.util.BaseGroovyObjectSupport
getMetaClass, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingTable

public CachingTable(Table tab,
                    int size)
             throws java.lang.Exception
Throws:
java.lang.Exception

CachingTable

public CachingTable(Table tab,
                    int size,
                    MultipleColumnFilter filter)
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

findByPK

public Record findByPK(butler.util.Tuple key)
                throws java.lang.Exception
Description copied from class: Table
Returns the record with the given (multi-column) primary key.

Overrides:
findByPK in class Table
Throws:
RecordNotFoundException
java.lang.Exception

save

public void save()