de.mguennewig.pobjects.filesystem
Class FileSystemContainer

java.lang.Object
  extended by de.mguennewig.pobjects.AbstractContainer
      extended by de.mguennewig.pobjects.filesystem.FileSystemContainer
All Implemented Interfaces:
Container

public final class FileSystemContainer
extends AbstractContainer

A file system container maps the file system tree into one table.

NOTE: This is a read-only container, which means you can not modify anything.

Author:
Michael Günnewig

Field Summary
 
Fields inherited from interface de.mguennewig.pobjects.Container
SUPPORTS_BOOLEAN, SUPPORTS_INHERITS, SUPPORTS_JOIN, SUPPORTS_LIMIT_OFFSET, SUPPORTS_ORACLE_JOIN, SUPPORTS_SQL99_JOIN, USE_ARRAY_FOR_LOB, USE_STREAM_TO_INSERT_LOB
 
Constructor Summary
FileSystemContainer()
           
FileSystemContainer(java.io.File rootPath)
           
 
Method Summary
 void close()
          
 int deleteAll(ClassDecl cl)
          Deletes all entries within the specified table.
 int deleteAll(ClassDecl cl, Column fk, java.lang.Object value)
          Deletes all entries within the specified table whose foreign key fk equals the given value.
 void deleteObject(PObject obj)
          Deletes the given persistent object from the database.
 boolean deleteRecord(Record obj)
          
 int getCapabilities()
          Returns the capabilities of the DBMS.
 java.io.File getRootPath()
           
 java.lang.String getSequenceCurrentValue(Sequence seq)
          Returns the current value of the given sequence.
 java.lang.String getSequenceNextValue(Sequence seq)
          Returns a new value of the given sequence.
 java.lang.String insertObject(PObject obj)
          Inserts the given object into the database.
 boolean insertRecord(Record obj)
          
 EvalContext newEvalContext(int numColumns)
          
 Query newQuery()
          Creates a new empty query.
 void retrieveData(PObject obj)
          Retrieves the data for the given persistent object from the database.
 void updateObject(PObject obj)
          Updates the given persistent object in the database.
 
Methods inherited from class de.mguennewig.pobjects.AbstractContainer
beginTransaction, commitTransaction, createObject, deleteAll, getClassDecl, getClassDecls, getData, getDictionary, getObject, getObject, getQualifiedName, getSchema, getTableExpr, isStrictMode, makePersistent, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, notifyChange, reset, rollbackTransaction, setStrictMode, storeAll, supportsBoolean, supportsInherits, supportsLimitOffset, supportsOracleJoin, supportsSQL99Join, useArrayForLob, useStreamToInsertLob
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemContainer

public FileSystemContainer()

FileSystemContainer

public FileSystemContainer(java.io.File rootPath)
Method Detail

getRootPath

public java.io.File getRootPath()

close

public void close()


getCapabilities

public int getCapabilities()
Returns the capabilities of the DBMS.

Returns:
Container.SUPPORTS_LIMIT_OFFSET and Container.SUPPORTS_BOOLEAN
See Also:
"The SUPPORTS_* constants."

getSequenceCurrentValue

public java.lang.String getSequenceCurrentValue(Sequence seq)
Returns the current value of the given sequence.

Throws:
java.lang.UnsupportedOperationException - if database does not support sequences.

getSequenceNextValue

public java.lang.String getSequenceNextValue(Sequence seq)
Returns a new value of the given sequence.

Throws:
java.lang.UnsupportedOperationException - if database does not support sequences.

insertObject

public java.lang.String insertObject(PObject obj)
Inserts the given object into the database.

Throws:
java.lang.UnsupportedOperationException - as this container is read-only

updateObject

public void updateObject(PObject obj)
Updates the given persistent object in the database.

Throws:
java.lang.UnsupportedOperationException - as this container is read-only
See Also:
PObject.isPersistent()

deleteObject

public void deleteObject(PObject obj)
Deletes the given persistent object from the database.

Throws:
java.lang.UnsupportedOperationException - as this container is read-only
See Also:
PObject.isPersistent()

insertRecord

public boolean insertRecord(Record obj)

Throws:
java.lang.UnsupportedOperationException - as this container is read-only

deleteRecord

public boolean deleteRecord(Record obj)

Throws:
java.lang.UnsupportedOperationException - as this container is read-only

retrieveData

public void retrieveData(PObject obj)
Retrieves the data for the given persistent object from the database.


deleteAll

public int deleteAll(ClassDecl cl)
Deletes all entries within the specified table.

NOTE: The objects which represent a row of this table or refer to rows within it aren't updated. So the best way to ensure consistency is to finish the current active transaction before calling this method and afterwards doing a Container.reset().

Throws:
java.lang.UnsupportedOperationException - as this container is read-only

deleteAll

public int deleteAll(ClassDecl cl,
                     Column fk,
                     java.lang.Object value)
Deletes all entries within the specified table whose foreign key fk equals the given value.

NOTE: The objects which represent a row of this table or refer to rows within it aren't updated. So the best way to ensure consistency is to finish the current active transaction before calling this method and afterwards doing a Container.reset().

Throws:
java.lang.UnsupportedOperationException - as this container is read-only

newEvalContext

public EvalContext newEvalContext(int numColumns)


newQuery

public Query newQuery()
Creates a new empty query.