public class RMDataSource
extends com.reportmill.base.RMObject
implements java.beans.PropertyChangeListener
Modifier and Type | Class and Description |
---|---|
static interface |
RMDataSource.EntityResolver |
Constructor and Description |
---|
RMDataSource()
Creates a plain datasource.
|
Modifier and Type | Method and Description |
---|---|
void |
copyValues(RMDataSource aDataSource)
Tells this data source to make changes to duplicate settings in given data source.
|
void |
create()
Creates the data source remote site (database, directory file, etc.).
|
RMEntity |
createEntity(RMEntity anEntity)
Creates an entity in data source for given entity.
|
java.lang.Object |
createObject(RMEntity anEntity)
Creates and returns a new object for a given entity.
|
void |
delete()
Deletes this data source, assuming it corresponds to something that can be deleted, like a database.
|
void |
deleteEntity(RMEntity anEntity)
Deletes an entity in data source for given entity.
|
void |
deleteFile(RMFile aFile)
Deletes a file.
|
void |
deleteRow(RMRow aRow)
Registers row to be deleted.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
RMDataSource |
fromXML(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement,
java.lang.Object anOwner)
XML unarchival.
|
java.util.List<RMRow> |
getAllRows(RMEntity anEntity)
Returns all the rows for an entity.
|
java.util.Map |
getDataset()
Returns a sample dataset of objects associated with the datasource.
|
java.util.List |
getDataset(java.lang.String aKey)
Returns the named dataset from this datasource.
|
RMCondition |
getDefaultCondition(RMEntity anEntity)
Returns a default condition (or condition list) associated with data soruce.
|
java.util.List<RMProperty> |
getDefaultParameters(RMEntity anEntity)
Returns a list of default parameters associated with data source.
|
RMEntity |
getEntity(java.lang.String aKeyPath)
Returns the entity at the given key path.
|
java.lang.Class<? extends RMRow> |
getEntityClass(RMEntity anEntity)
Returns the class for a given entity.
|
RMDataSource.EntityResolver |
getEntityResolver()
Returns the custom entity resolver.
|
RMFile |
getFile(java.lang.String aPath)
Returns the individual file with the given path.
|
RMFile |
getFile(java.lang.String aPath,
boolean doCreate)
Returns the individual file with the given path, with an option to create it, if missing.
|
RMFile |
getFile(java.lang.String aPath,
boolean doCreate,
boolean isDirectory)
Returns the individual file with the given path, with an option to create it, if missing.
|
java.util.List<? extends RMFile> |
getFilesImpl(java.lang.String aPath)
Returns files at path.
|
java.lang.String |
getName()
Returns the name for the datasource.
|
java.util.List<? extends RMProperty> |
getQueryParameters(RMEntity anEntity)
Returns the query parameters.
|
RMFile |
getRootDirectory()
Returns the root directory.
|
RMRow |
getRow(RMEntity anEntity,
RMCondition aCondition)
Returns a cached row for a entity and condition.
|
RMRow |
getRow(java.lang.String anEntityName,
RMCondition aCondition)
Returns a cached row for an entity name and condition.
|
java.util.List<RMRow> |
getRows(java.util.List<? extends RMProperty> theProperties,
RMCondition aCondition)
Returns a set of rows for the given properties and condition.
|
RMSchema |
getSchema()
Returns the schema of represented datasource as a hierarchy of RMEntity and RMProperty objects.
|
RMSchema |
getSchemaVisible()
Returns the schema that should be visible to users.
|
java.lang.String |
getTypeString()
Returns the type string.
|
RMRow |
getUniqueRow(RMRow aRow)
Returns any previously loaded incarnation of given row, based on its primary key, otherwise it returns the given
row (after adding it to allRows for row entity).
|
void |
insertRow(RMRow aRow)
Registers row to be inserted.
|
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
Overridden to track property changes.
|
void |
readFile(RMFile aFile)
Reads a file (bytes really).
|
void |
refresh()
Clears all cached data in the data source, forcing everything to reload.
|
void |
saveRows()
Save row changes.
|
void |
saveRowsImmediately()
Save row changes immediately.
|
void |
setEntityResolver(RMDataSource.EntityResolver anEntityResolver)
Sets the custom entity resolver.
|
void |
setName(java.lang.String aName)
Sets the name for the datasource.
|
java.lang.String |
toString()
Returns a string representation of the datasource (just its name).
|
com.reportmill.archiver.RXElement |
toXML(com.reportmill.archiver.RXArchiver anArchiver,
java.lang.Object anOwner)
XML archival.
|
void |
updateRow(RMRow aRow)
Registers row to be updated.
|
void |
writeFile(RMFile aFile)
Writes a file (bytes really).
|
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
public java.lang.String getName()
public void setName(java.lang.String aName)
public java.lang.String getTypeString()
public RMSchema getSchema()
public RMSchema getSchemaVisible()
public java.util.Map getDataset()
public java.util.List getDataset(java.lang.String aKey)
public java.lang.Object createObject(RMEntity anEntity)
public RMEntity getEntity(java.lang.String aKeyPath)
public RMRow getRow(java.lang.String anEntityName, RMCondition aCondition)
public RMRow getRow(RMEntity anEntity, RMCondition aCondition)
public java.util.List<RMRow> getRows(java.util.List<? extends RMProperty> theProperties, RMCondition aCondition)
public java.util.List<RMRow> getAllRows(RMEntity anEntity)
public RMRow getUniqueRow(RMRow aRow)
public void insertRow(RMRow aRow)
public void updateRow(RMRow aRow)
public void deleteRow(RMRow aRow)
public java.lang.Class<? extends RMRow> getEntityClass(RMEntity anEntity)
public RMDataSource.EntityResolver getEntityResolver()
public void setEntityResolver(RMDataSource.EntityResolver anEntityResolver)
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
propertyChange
in interface java.beans.PropertyChangeListener
public void saveRows()
public void saveRowsImmediately()
public RMFile getRootDirectory()
public RMFile getFile(java.lang.String aPath)
public RMFile getFile(java.lang.String aPath, boolean doCreate)
public RMFile getFile(java.lang.String aPath, boolean doCreate, boolean isDirectory)
public java.util.List<? extends RMFile> getFilesImpl(java.lang.String aPath)
public void readFile(RMFile aFile)
public void writeFile(RMFile aFile)
public void deleteFile(RMFile aFile)
public RMEntity createEntity(RMEntity anEntity)
public void deleteEntity(RMEntity anEntity)
public void create()
public void delete()
public void copyValues(RMDataSource aDataSource)
public java.util.List<RMProperty> getDefaultParameters(RMEntity anEntity)
public RMCondition getDefaultCondition(RMEntity anEntity)
public java.util.List<? extends RMProperty> getQueryParameters(RMEntity anEntity)
public void refresh()
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
public RMDataSource fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
public java.lang.String toString()
toString
in class com.reportmill.base.RMObject