|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hardcode.gdbms.engine.data.db.DBTableDataSourceAdapter
public class DBTableDataSourceAdapter
Adaptador de la interfaz DBDriver a la interfaz DataSource. Adapta las interfaces de los drivers de base de datos a la interfaz DataSource.
| Constructor Summary | |
|---|---|
DBTableDataSourceAdapter(java.lang.String name,
java.lang.String alias,
DBSource def,
AlphanumericDBDriver driver)
Creates a new DBTableDataSourceAdapter |
|
| Method Summary | |
|---|---|
void |
addEditionListener(EditionListener listener)
Adds an EditionListener to the DataSource |
void |
addField(java.lang.String name,
java.lang.String type)
Adds a field to the DataSource |
void |
addField(java.lang.String name,
java.lang.String type,
java.lang.String[] paramNames,
java.lang.String[] paramValues)
Adds a field to the DataSource |
void |
addMetadataEditionListener(MetadataEditionListener listener)
Adds a listener for the Metadata edition events |
void |
addSelectionListener(SelectionListener listener)
Adds an SelectionListener to the DataSource |
void |
beginTrans()
Begins a transaction |
boolean |
canRedo()
|
boolean |
canUndo()
|
java.lang.String |
check(int fieldId,
Value value)
Checks if this value is a valid one for the specified field. |
void |
commitTrans()
Commits the changes made during the transaction. |
void |
deleteRow(long rowId)
Deletes the ith row of the DataSource |
void |
endUndoRedoAction()
Notifies this DataSource that the next edition operations no longer are caused by an undo or redo operation |
void |
execute(java.lang.String sql)
Executes the 'sql' instruction |
java.lang.String |
getAlias()
Returns the alias used in this DataSource |
java.lang.String |
getAsString()
Gets the string representation of this DataSource |
java.sql.Connection |
getConnection()
Get's a connection to the driver |
DBTableSourceDefinition |
getDataSourceDefinition()
|
DataSourceFactory |
getDataSourceFactory()
gets a reference to the factory object that created the DataSource |
Metadata |
getDataSourceMetadata()
Gets the meta data about the source of this DataSource |
java.lang.String |
getDBMS()
|
int |
getDispatchingMode()
Gets the dispatchingMode property |
DBDriver |
getDriver()
DOCUMENT ME! |
DriverMetadata |
getDriverMetadata()
Gets the driver metadata |
int |
getFieldCount()
|
int |
getFieldIndexByName(java.lang.String fieldName)
Obtiene el indice de un campo a partir de su nombre o -1 si no existe un campo con ese nombre |
java.lang.String |
getFieldName(int fieldId)
|
java.lang.String[] |
getFieldNames()
Gets the field names array |
int |
getFieldType(int i)
|
Value |
getFieldValue(long rowIndex,
int fieldId)
Obtiene el valor que se encuentra en la fila y columna indicada |
Memento |
getMemento()
Gets a memento object with the current status of the DataSource |
java.lang.String |
getName()
Devuelve el nombre del DataSource |
DriverMetadata |
getOriginalDriverMetadata()
Gets the driver specific metadata from the driver directly without the new, modified or deleted fields |
int |
getOriginalFieldCount()
Gets the number of field this DataSource had before edition started |
Value |
getOriginalFieldValue(long rowIndex,
int fieldId)
Gets the value of the DataSource field before the edition started |
Metadata |
getOriginalMetadata()
Gets the Metadata from the driver without taking care of added, removed or modified fields. |
long |
getOriginalRowCount()
|
int |
getPKCardinality()
|
java.lang.String |
getPKName(int fieldId)
|
java.lang.String[] |
getPKNames()
|
ValueCollection |
getPKValue(long rowIndex)
|
Value[] |
getRow(long rowIndex)
Gets the value of all fields at the specified row |
long |
getRowCount()
Obtiene el número de registros del DataSource |
int[] |
getSelectedRows()
Gets the row selection |
int |
getType(java.lang.String driverType)
Returns the suitable GDBMS type for the given driver specific type |
long[] |
getWhereFilter()
Devuelve el filtro que resultó de la cláusula where de la instrucción que dió como resultado este DataSource. |
void |
insertEmptyRow()
Inserts a row at the end of the dataware |
void |
insertEmptyRowAt(long index)
Inserts a row at the end of the dataware |
void |
insertFilledRow(Value[] values)
Inserts a row at the end of the dataware with the specified values |
void |
insertFilledRowAt(long index,
Value[] values)
Inserts a row at the end of the dataware with the specified values |
boolean |
isModified()
Returns true if the DataSource has been modified since it was created. |
void |
redo()
Redoes the last undone edition action |
void |
remove()
Removes from the system the data source this DataSource instance represents. |
void |
removeEditionListener(EditionListener listener)
Removes an EditionListener from the DataSource |
void |
removeField(int index)
Removes the field at the indexth position |
void |
removeMetadataEditionListener(MetadataEditionListener listener)
Removes a listener for the Metadata edition events |
void |
removeSelectionListener(SelectionListener listener)
Removes an SelectionListener from the DataSource |
void |
rollBackTrans()
Cancels the changes made during the transaction |
void |
saveData(DataSource ds)
Saves the data in the parameter DataSource in the source of this DataSource. |
void |
setAlias(java.lang.String alias)
|
void |
setDataSourceFactory(DataSourceFactory dsf)
Sets the DataSourceFactory that created the DataSource instance |
void |
setDispatchingMode(int dispatchingMode)
Defines the behaviour of the DataSource when an edition event happens. |
void |
setFieldName(int index,
java.lang.String name)
Sets the name of the field at the indexth position |
void |
setFieldValue(long row,
int fieldId,
Value value)
Sets the value of a cell of the table. |
void |
setName(java.lang.String name)
|
void |
setSelectedRows(int[] sel)
Sets the row selection |
void |
setTableName(java.lang.String tableName)
|
void |
start()
Opens the DataSource to access the data it contains. |
void |
startUndoRedoAction()
Notifies this DataSource that the next edition operations are caused by an undo or redo operation |
void |
stop()
Closes the DataSource. |
void |
undo()
Undoes the last edition action |
void |
undoDeletion(int index,
Value[] row)
Notifies the adapter that the specified index deletion is being undone |
void |
undoInsert(long row)
|
void |
undoSet(long row,
int field,
Value value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DBTableDataSourceAdapter(java.lang.String name,
java.lang.String alias,
DBSource def,
AlphanumericDBDriver driver)
| Method Detail |
|---|
public java.lang.String getAlias()
DataSource
getAlias in interface DataSource
public java.lang.String getAsString()
throws DriverException
DataSource
getAsString in interface DataSourceDriverExceptionpublic DataSourceFactory getDataSourceFactory()
DataSource
getDataSourceFactory in interface DataSource
public java.lang.String[] getFieldNames()
throws DriverException
DataSource
getFieldNames in interface DataSourcegetFieldNames in interface PKEditableDataSourceDriverException - if the access fails
public Memento getMemento()
throws MementoException
DataSource
getMemento in interface DataSourceMementoException - If the state cannot be obtainedpublic java.lang.String getName()
DataSource
getName in interface DataSource
public Value[] getRow(long rowIndex)
throws DriverException
DataSource
getRow in interface DataSourcerowIndex - index of the row to be retrieved
DriverException - If the access fails
public long[] getWhereFilter()
throws java.io.IOException
DataSource
getWhereFilter in interface DataSourcejava.io.IOException - Si se produce un error accediendo a las estructuras
de datos internas
public void remove()
throws DriverException
DataSource
remove in interface DataSourceDriverException - if the DataSource original system could not be
cleaned properlypublic void setAlias(java.lang.String alias)
public void setDataSourceFactory(DataSourceFactory dsf)
DataSource
setDataSourceFactory in interface DataSourcedsf - DataSourceFactorypublic void setName(java.lang.String name)
public int getFieldCount()
throws DriverException
getFieldCount in interface EditableDataSourceDriverException
public int getFieldIndexByName(java.lang.String fieldName)
throws DriverException
DataSource
getFieldIndexByName in interface DataSourcefieldName - Nombre del campo
DriverException - Si se produce un error accediendo a los datos
public void start()
throws DriverException
DataSource
start in interface DataSourceDriverException - if the operation fails
public void stop()
throws DriverException,
AlreadyClosedException
DataSource
stop in interface DataSourceDriverException - If the operation fails
AlreadyClosedException
public long getRowCount()
throws DriverException
ReadAccess
getRowCount in interface ReadAccessDriverException - Si se produce algún error accediendo al
DataSourceReadAccess.getRowCount()
public java.lang.String getFieldName(int fieldId)
throws DriverException
getFieldName in interface EditableDataSourceDriverExceptionEditableDataSource.getFieldName(int)
public int getFieldType(int i)
throws DriverException
getFieldType in interface EditableDataSourceDriverExceptioncom.hardcode.gdbms.engine.data.driver.ObjectDriver#getFieldType(int)
public Value getFieldValue(long rowIndex,
int fieldId)
throws DriverException
ReadAccess
getFieldValue in interface ReadAccessrowIndex - filafieldId - columna
DriverException - Si se produce un error accediendo al DataSourceReadAccess.getFieldValue(long,
int)
public Value getOriginalFieldValue(long rowIndex,
int fieldId)
throws DriverException
EditableDataSource
getOriginalFieldValue in interface EditableDataSourceDriverException
public long getOriginalRowCount()
throws DriverException
getOriginalRowCount in interface PKEditableDataSourceDriverExceptionpublic DBDriver getDriver()
getDriver in interface DataSource
public void execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface PKEditableDataSourcejava.sql.SQLException - If the execution fails
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface PKEditableDataSourcejava.sql.SQLException - if the connection cannot be establishedpublic java.lang.String getDBMS()
com.hardcode.gdbms.engine.data.DataSource#getDBMS()public void setTableName(java.lang.String tableName)
public DBTableSourceDefinition getDataSourceDefinition()
public void deleteRow(long rowId)
throws DriverException
AlphanumericDataSource
deleteRow in interface AlphanumericDataSourcerowId - index of the row to be deleted
DriverException - if the row could not be deleted
public void insertFilledRow(Value[] values)
throws DriverException
DataSource
insertFilledRow in interface DataSourcevalues - Values of the inserted row fields in the field order
DriverException - if the row could not be inserted
public void insertEmptyRow()
throws DriverException
DataSource
insertEmptyRow in interface DataSourceDriverException - if the row could not be inserted
public void insertFilledRowAt(long index,
Value[] values)
throws DriverException
AlphanumericDataSource
insertFilledRowAt in interface AlphanumericDataSourceindex - index where the row will be inserted. No data is lost.values - Values of the inserted row fields in the field order
DriverException - if the row could not be inserted
public void insertEmptyRowAt(long index)
throws DriverException
AlphanumericDataSource
insertEmptyRowAt in interface AlphanumericDataSourceindex - index where the row will be inserted. No data is lost.
DriverException - if the row could not be inserted
public void beginTrans()
throws DriverException
DataSource
beginTrans in interface DataSourceDriverException - If the transaction could not be started
public void commitTrans()
throws DriverException,
FreeingResourcesException
DataSource
commitTrans in interface DataSourceDriverException - If the transaction could not be commited
FreeingResourcesException - The commit was correctly done but a problem occured
while freeing resources
public void rollBackTrans()
throws DriverException
DataSource
rollBackTrans in interface DataSourceDriverException - If the transaction could not be cancelled
public void setFieldValue(long row,
int fieldId,
Value value)
throws DriverException
DataSource
setFieldValue in interface DataSourcerow - row to updatefieldId - field to updatevalue - Value to update
DriverException - If the operation failed
public java.lang.String getPKName(int fieldId)
throws DriverException
DriverExceptioncom.hardcode.gdbms.engine.data.DataSource#getPKName(int)
public int getPKCardinality()
throws DriverException
DriverExceptioncom.hardcode.gdbms.engine.data.DataSource#getPKCardinality()
public java.lang.String[] getPKNames()
throws DriverException
getPKNames in interface PKEditableDataSourceDriverExceptioncom.hardcode.gdbms.engine.data.DataSource#getPKNames()
public void saveData(DataSource ds)
throws DriverException
DataSource
saveData in interface DataSourceds - DataSource with the data
DriverException - if the operation failsDataSource.saveData(com.hardcode.gdbms.engine.data.DataSource)
public ValueCollection getPKValue(long rowIndex)
throws DriverException
getPKValue in interface PKEditableDataSourceDriverExceptionpublic boolean canRedo()
canRedo in interface DataSourcepublic boolean canUndo()
canUndo in interface DataSource
public void redo()
throws DriverException
DataSource
redo in interface DataSourceDriverException
public void undo()
throws DriverException
DataSource
undo in interface DataSourceDriverExceptionpublic void addEditionListener(EditionListener listener)
DataSource
addEditionListener in interface DataSourcepublic void removeEditionListener(EditionListener listener)
DataSource
removeEditionListener in interface DataSourcepublic void setDispatchingMode(int dispatchingMode)
DataSource
setDispatchingMode in interface DataSourcepublic int getDispatchingMode()
DataSource
getDispatchingMode in interface DataSource
public void addField(java.lang.String name,
java.lang.String type)
throws DriverException
DataSource
addField in interface DataSourcename - name of the fieldtype - driver specific type name
DriverException
public void addField(java.lang.String name,
java.lang.String type,
java.lang.String[] paramNames,
java.lang.String[] paramValues)
throws DriverException
DataSource
addField in interface DataSourcename - name of the fieldtype - driver specific type name
DriverExceptionpublic void addMetadataEditionListener(MetadataEditionListener listener)
DataSource
addMetadataEditionListener in interface DataSourcepublic Metadata getDataSourceMetadata()
DataSource
getDataSourceMetadata in interface DataSource
public int getOriginalFieldCount()
throws DriverException
EditableDataSource
getOriginalFieldCount in interface EditableDataSourceDriverException
public void removeField(int index)
throws DriverException
DataSource
removeField in interface DataSourceDriverExceptionpublic void removeMetadataEditionListener(MetadataEditionListener listener)
DataSource
removeMetadataEditionListener in interface DataSource
public void setFieldName(int index,
java.lang.String name)
throws DriverException
DataSource
setFieldName in interface DataSourceDriverException
public Metadata getOriginalMetadata()
throws DriverException
EditableDataSource
getOriginalMetadata in interface EditableDataSourceDriverException
public DriverMetadata getDriverMetadata()
throws DriverException
DataSource
getDriverMetadata in interface DataSourceDriverExceptionpublic int getType(java.lang.String driverType)
EditableDataSource
getType in interface EditableDataSource
public DriverMetadata getOriginalDriverMetadata()
throws DriverException
EditableDataSource
getOriginalDriverMetadata in interface EditableDataSourceDriverException
public java.lang.String check(int fieldId,
Value value)
throws DriverException
DataSource
check in interface DataSourceDriverExceptionpublic void endUndoRedoAction()
EditableDataSource
endUndoRedoAction in interface EditableDataSourcepublic void startUndoRedoAction()
EditableDataSource
startUndoRedoAction in interface EditableDataSourcepublic boolean isModified()
DataSource
isModified in interface DataSourcepublic int[] getSelectedRows()
DataSource
getSelectedRows in interface DataSourcepublic void setSelectedRows(int[] sel)
DataSource
setSelectedRows in interface DataSourcepublic void addSelectionListener(SelectionListener listener)
DataSource
addSelectionListener in interface DataSourcepublic void removeSelectionListener(SelectionListener listener)
DataSource
removeSelectionListener in interface DataSource
public void undoDeletion(int index,
Value[] row)
throws DriverException
EditableDataSource
undoDeletion in interface EditableDataSourceDriverException
public void undoSet(long row,
int field,
Value value)
throws DriverException
undoSet in interface EditableDataSourceDriverException
public void undoInsert(long row)
throws DriverException
undoInsert in interface EditableDataSourceDriverException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||