|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.cache.metadata.MetadataCache
This class implements a ResultSet metadata cache.
ResultSet Fields are kept here to prevent recomputing them and allocating them each time a query is executed.
Field Summary | |
private java.util.Hashtable |
fieldCache
|
private static Trace |
logger
|
private int |
maxNbOfField
|
private int |
maxNbOfMetadata
|
private java.util.Hashtable |
metadataCache
|
Constructor Summary | |
MetadataCache(int maxNbOfMetadata,
int maxNbOfField)
Constructor for MetadataCache. |
Method Summary | |
void |
addField(java.lang.String fullyQualifiedFieldName,
Field field)
Add a Field entry to the cache and associate it to the given name. |
void |
addMetadata(AbstractRequest request,
Field[] metadata)
Add a metadata entry to the cache and associate it to the given request. |
void |
flushCache()
Flush the cache |
Field |
getField(java.lang.String fullyQualifiedFieldName)
Get the field corresponding to a column name. |
Field[] |
getMetadata(AbstractRequest request)
Get metadata associated to a request. |
java.lang.String |
getXml()
Get xml information about this ParsingCache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Trace logger
private java.util.Hashtable metadataCache
private java.util.Hashtable fieldCache
private int maxNbOfMetadata
private int maxNbOfField
Constructor Detail |
public MetadataCache(int maxNbOfMetadata, int maxNbOfField)
maxNbOfMetadata
- maximum nb of entries in metadata cachemaxNbOfField
- maximum nb of entries in field cacheMethod Detail |
public void flushCache()
public Field[] getMetadata(AbstractRequest request)
Returns null if the cache contains no metadata for the given request.
request
- the request we look for
public void addMetadata(AbstractRequest request, Field[] metadata)
request
- request to which the metadata belongmetadata
- metadata to cachepublic Field getField(java.lang.String fullyQualifiedFieldName)
Returns null if the cache contains no field for the given name.
fullyQualifiedFieldName
- the field name (table.column) to look for
public void addField(java.lang.String fullyQualifiedFieldName, Field field)
fullyQualifiedFieldName
- table.column name that uniquely identifies
the fieldfield
- field to cachepublic java.lang.String getXml()
String
in xml formatted text
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |