|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.biosoft.access.DataElementSupport
ru.biosoft.access.AbstractDataCollection
ru.biosoft.access.SqlDataCollection
DataCollection which store all information in SQL DBMS.
DataCollection,
SqlTransformer| Nested Class Summary | |
protected class |
SqlDataCollection.SQLIterator
Implement Iterator for iterate SqlDataCollection elements. |
| Field Summary | |
static java.lang.String |
JDBC_DRIVER_PROPERTY
Property for storing class of jdbc driver. |
static java.lang.String |
JDBC_PASSWORD_PROPERTY
Property for storing user password for connecting to the DBMS. |
static java.lang.String |
JDBC_URL_PROPERTY
Property for storing driver specific URL for connecting to the DBMS. |
static java.lang.String |
JDBC_USER_PROPERTY
Property for storing user name for connecting to the DBMS. |
static java.lang.String |
TRANSFORMER_CLASS_PROPERTY
Property for storing class of that should be used for converting DataElements to/from DBMS. |
| Fields inherited from class ru.biosoft.access.AbstractDataCollection |
cat, info, notificationEnabled, path, propagationEnabled, v_cache |
| Constructor Summary | |
SqlDataCollection(DataCollection parent,
java.util.Properties properties)
Standart constructor for creating data collection. |
|
| Method Summary | |
void |
close()
Close connection to DBMS. |
boolean |
contains(java.lang.String name)
Returns true if data collection contain element with the specified name. |
protected DataElement |
doGet(java.lang.String name)
Extracts and returns DataElement with specified name from the data collection. |
protected void |
doPut(DataElement de,
boolean isNew)
Adds the specified data element to the collection. |
protected void |
doRemove(java.lang.String name)
Remove DataElement from data collection. |
protected void |
finalize()
Close collection if one not closed. |
java.sql.Connection |
getConnection()
Return active connection. |
java.lang.Class |
getDataElementType()
Return type of DataElement stored in this data collection. |
java.util.List |
getNameList()
Gets list of all names in data collection. |
int |
getSize()
Returns size of data collection. |
SqlTransformer |
getTransformer()
|
boolean |
isMutable()
Returns true if this data collection is mutable.
|
java.util.Iterator |
iterator()
Returns an iterator over the data elements in this collection. |
protected void |
putInCache(DataElement de)
Put element in cache. |
| Methods inherited from class ru.biosoft.access.DataElementSupport |
getName, getOrigin, registerConstructorWithBadEqual |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ru.biosoft.access.DataElement |
getName, getOrigin |
| Field Detail |
public static final java.lang.String JDBC_DRIVER_PROPERTY
public static final java.lang.String JDBC_URL_PROPERTY
public static final java.lang.String JDBC_USER_PROPERTY
public static final java.lang.String JDBC_PASSWORD_PROPERTY
public static final java.lang.String TRANSFORMER_CLASS_PROPERTY
| Constructor Detail |
public SqlDataCollection(DataCollection parent,
java.util.Properties properties)
throws java.lang.ClassNotFoundException,
java.sql.SQLException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
JDBC_DRIVER_PROPERTYJDBC_URL_PROPERTYJDBC_USER_PROPERTYJDBC_PASSWORD_PROPERTYTRANSFORMER_CLASS_PROPERTY
parent - Parent collection.properties - Properties for creating collection (cannot be null).JDBC_DRIVER_PROPERTY,
JDBC_URL_PROPERTY,
JDBC_USER_PROPERTY,
JDBC_PASSWORD_PROPERTY,
TRANSFORMER_CLASS_PROPERTY| Method Detail |
public final java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - If operation on DBMS failed.public SqlTransformer getTransformer()
public java.lang.Class getDataElementType()
getDataElementType in interface DataCollectiongetDataElementType in class AbstractDataCollectionSqlTransformerpublic boolean isMutable()
true if this data collection is mutable.
Check Connection is read only or not.
isMutable in interface DataCollectionisMutable in class AbstractDataCollectionConnectionpublic int getSize()
getSize in interface DataCollectiongetSize in class AbstractDataCollectionpublic java.util.List getNameList()
AbstractDataCollection
getNameList in interface DataCollectiongetNameList in class AbstractDataCollectionpublic boolean contains(java.lang.String name)
contains in interface DataCollectioncontains in class AbstractDataCollectionname - name of element whose presence in this data collection is to be tested.
AbstractDataCollection.contains(ru.biosoft.access.DataElement)public java.util.Iterator iterator()
SQLDataCollection.SQLIterator
public void close()
throws java.lang.Exception
close in interface DataCollectionclose in class AbstractDataCollectionjava.lang.Exceptionprotected void putInCache(DataElement de)
de - DataElement that should be added into the cache.AbstractDataCollection.put(DataElement)
protected DataElement doGet(java.lang.String name)
throws java.lang.Exception
doGet in class AbstractDataCollectionname - Name of the data element (PK).
java.sql.SQLException - if cannot execute SELECT statement.
java.lang.Exception - if transformer failed to create DataElement instance.SqlTransformer.getElementQuery(String)
protected void doRemove(java.lang.String name)
throws java.sql.SQLException
doRemove in class AbstractDataCollectionjava.sql.SQLException - If cannot execute DELETE statement generated by transformer.ru.biosoft.access.SqlTransformer#getDeleteQuery(String)
protected void doPut(DataElement de,
boolean isNew)
throws java.lang.Exception
doPut in class AbstractDataCollectionjava.sql.SQLException - If cannot execute Insert or Update statement generated by transformer.java.lang.Exceptionru.biosoft.access.SqlTransformer#getInsertQuery(DataElement),
ru.biosoft.access.SqlTransformer#getUpdateQuery(DataElement)
protected void finalize()
throws java.lang.Throwable
finalize in class AbstractDataCollectionjava.lang.Exception - If error occured.
java.lang.Throwable - the Exception raised by this methodclose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||