com.jenkov.mrpersister.itf
Interface ISqlCache

All Known Implementing Classes:
SqlCache

public interface ISqlCache

This interface represents all functions made available by the SQL caches in Mr. Persister. The responsibility of the SQL cache is to keep generated SQL strings in memory so they don't have to be regenerated everytime they are needed.

Author:
Jakob Jenkov, Jenkov Development

Method Summary
 void clear()
          Removes all SQL statements stored in this cache.
 boolean containsStatement(java.lang.Object mappingKey)
          Returns true if the SQL cache contains a statement for the given object method key.
 java.lang.String getStatement(java.lang.Object mappingKey)
          Returns the SQL statement for this object method key.
 void removeStatement(java.lang.Object mappingKey)
          Removes the SQL statement stored for this object method key.
 int size()
          Returns the number of SQL statements stored in this cache.
 void storeStatement(java.lang.Object mappingKey, java.lang.String insertStatement)
          Stores the given string as an SQL statement for the given object method key.
 

Method Detail

containsStatement

boolean containsStatement(java.lang.Object mappingKey)
Returns true if the SQL cache contains a statement for the given object method key. False if not.

Parameters:
mappingKey - The object method key to check if the SQL cache contains a statement for.
Returns:
True if the SQL cache contains a statement for the given mappingkey . False if not.

getStatement

java.lang.String getStatement(java.lang.Object mappingKey)
Returns the SQL statement for this object method key. Returns null if no SQL statement is stored for this object method key in this cache.

Parameters:
mappingKey - The object method key to get the SQL statement for.
Returns:
The SQL statement for the given object method key. Null if no SQL statement is stored in the cache for the given object method key.

storeStatement

void storeStatement(java.lang.Object mappingKey,
                    java.lang.String insertStatement)
Stores the given string as an SQL statement for the given object method key.

Parameters:
mappingKey - The object method key to store the statement for.
insertStatement - The SQL statement to store.

removeStatement

void removeStatement(java.lang.Object mappingKey)
Removes the SQL statement stored for this object method key.

Parameters:
mappingKey - The object method to remove the statement for.

clear

void clear()
Removes all SQL statements stored in this cache.


size

int size()
Returns the number of SQL statements stored in this cache.

Returns:
The number of SQL statements stored in this cache.