com.hardcode.gdbms.engine.strategies
Class PDataSource

java.lang.Object
  extended by com.hardcode.gdbms.engine.strategies.OperationDataSource
      extended by com.hardcode.gdbms.engine.strategies.PDataSource
All Implemented Interfaces:
DataSource, ReadAccess

public class PDataSource
extends OperationDataSource

Clase que representa el producto cartesiano de dos o más tablas. El almacenamiento de dicha tabla se realiza en las propias tablas sobre las que se opera, haciendo los cálculos en cada acceso para saber en qué tabla y en qué posición de la tabla se encuentra el dato buscado

Author:
Fernando González Cortés

Field Summary
 
Fields inherited from interface com.hardcode.gdbms.engine.data.DataSource
COHERENT_ROW_ORDER, DIRECT_MODE, DISPATCH, IGNORE, STORE
 
Constructor Summary
PDataSource(DataSource[] tables)
          Creates a new PDataSource object.
 
Method Summary
 Metadata getDataSourceMetadata()
          Gets the meta data about the source of this DataSource
 int getFieldCount()
           
 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
 long getRowCount()
          Obtiene el número de registros del DataSource
 void start()
          Opens the DataSource to access the data it contains.
 void stop()
          Closes the DataSource.
 
Methods inherited from class com.hardcode.gdbms.engine.strategies.OperationDataSource
addEditionListener, addField, addField, addMetadataEditionListener, addSelectionListener, beginTrans, canRedo, canUndo, check, commitTrans, deleteRow, getAlias, getAsString, getDataSourceFactory, getDispatchingMode, getDriver, getDriverMetadata, getFieldIndexByName, getFieldNames, getName, getRow, getSelectedRows, getSQL, getWhereFilter, insertEmptyRow, insertEmptyRowAt, insertFilledRow, insertFilledRowAt, isModified, redo, remove, removeEditionListener, removeField, removeMetadataEditionListener, removeSelectionListener, rollBackTrans, saveData, setAlias, setDataSourceFactory, setDispatchingMode, setFieldName, setFieldValue, setName, setSelectedRows, setSQL, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDataSource

public PDataSource(DataSource[] tables)
Creates a new PDataSource object.

Parameters:
tables - Array de tablas que forman el producto
Throws:
DriverException
Method Detail

getFieldValue

public Value getFieldValue(long rowIndex,
                           int fieldId)
                    throws DriverException
Description copied from interface: ReadAccess
Obtiene el valor que se encuentra en la fila y columna indicada

Parameters:
rowIndex - fila
fieldId - columna
Returns:
subclase de Value con el valor del origen de datos. Never null (use ValueFactory.createNullValue() instead)
Throws:
DriverException - Si se produce un error accediendo al DataSource
See Also:
com.hardcode.gdbms.data.DataSource#getIntFieldValue(int, int)

getFieldCount

public int getFieldCount()
                  throws DriverException
Throws:
DriverException
See Also:
com.hardcode.gdbms.data.DataSource#getFieldCount()

getRowCount

public long getRowCount()
Description copied from interface: ReadAccess
Obtiene el número de registros del DataSource

Returns:
See Also:
com.hardcode.gdbms.data.DataSource#getRowCount()

start

public void start()
           throws DriverException
Description copied from interface: DataSource
Opens the DataSource to access the data it contains. If the data is accessed without a previous opening a ClosedDataSourceException is thrown. If this method is invoked twice then only the second call to stop will close the DataSource.
If the DataSource was obtained with an AUTOMATIC_OPENING mode, there's no need to open the DataSource. Indeed start calls are ignored. It's possible to close the DataSource by a single call to the close method

Throws:
DriverException - if the operation fails
See Also:
com.hardcode.gdbms.data.DataSource#open(java.io.File)

stop

public void stop()
          throws DriverException
Description copied from interface: DataSource
Closes the DataSource. After a DataSource is closed it's data cannot be retrieved. Any attempt to do so will result in a DataSourceClosedException

Throws:
DriverException - If the operation fails
See Also:
com.hardcode.gdbms.data.DataSource#close()

getMemento

public Memento getMemento()
                   throws MementoException
Description copied from interface: DataSource
Gets a memento object with the current status of the DataSource

Specified by:
getMemento in interface DataSource
Overrides:
getMemento in class OperationDataSource
Returns:
DataSourceMemento
Throws:
MementoException - If the state cannot be obtained
See Also:
DataSource.getMemento()

getDataSourceMetadata

public Metadata getDataSourceMetadata()
                               throws DriverException
Description copied from interface: DataSource
Gets the meta data about the source of this DataSource

Returns:
DataSourceMetadata
Throws:
DriverException - If cannot get the DataSource metadata


Copyright © 2005-2006 . All Rights Reserved.