|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.persist.AbstractBroker | +--com.objectwave.persist.broker.FileBroker
A broker that will write persistent objects out to files. Requires that the persistent objects use the RDBPersistence as their interface.
Nested Class Summary | |
static class |
FileBroker.Test
Unit tests. |
Field Summary | |
protected java.util.HashMap |
dbFiles
Description of the Field |
Fields inherited from class com.objectwave.persist.AbstractBroker |
exceptionConverter, metrics, props, verbose |
Constructor Summary | |
FileBroker()
Initialize the local variables. |
Method Summary | |
protected java.lang.Object |
actualFind(DbFile file,
SQLQuery query,
Persistence p)
|
void |
beginTransaction()
Do transactions make sense? |
void |
close()
Shutdown gracefully. |
void |
commit()
Description of the Method |
void |
delete(Persistence obj)
Remove the provided object from the persistence mechanism. |
void |
deleteAll(SQLQuery q)
Description of the Method |
java.lang.Object |
find(SQLQuery query)
The return type of object allows the support of multiple collection types. |
java.util.Vector |
findAttributes(SQLQuery q,
java.lang.String[] at)
|
Persistence |
findUnique(SQLQuery query)
|
protected DbFile |
getFile(java.lang.String fileName)
|
static RDBPersistence |
getRDBAdapter(Persistence object)
A utility method that simplifies code. |
protected java.lang.String |
getTargetFileName(java.lang.String fileName)
|
void |
initialize()
Establish the property settings for this object. |
protected void |
release(DbFile dbConnection)
Make the 'dbConnection' available to other processes. |
void |
rollback()
|
void |
save(Persistence obj)
Write the change to the persistence store. |
void |
saveObjects(java.util.ArrayList saveList)
Save all of the objects provided and be sure to take into account bidirectional relationships. |
Methods inherited from class com.objectwave.persist.AbstractBroker |
convertException, convertException, count, deleteObjects, getExceptionConverter, println, setBrokerProperty, setExceptionConverter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.HashMap dbFiles
Constructor Detail |
public FileBroker()
Method Detail |
public static final RDBPersistence getRDBAdapter(Persistence object)
object
- Description of Parameter
protected DbFile getFile(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the file to create.
java.io.IOException
- Description of Exceptionprotected java.lang.String getTargetFileName(java.lang.String fileName)
fileName
- A file name independent of extensions or pathing
public void initialize()
public void beginTransaction() throws QueryException
QueryException
- Description of Exceptionpublic void commit() throws QueryException
QueryException
- Description of Exceptionpublic void delete(Persistence obj) throws QueryException
obj
- A class to be deleted.
QueryException
- Description of Exceptionpublic void close()
close
in interface Broker
close
in class AbstractBroker
public java.lang.Object find(SQLQuery query) throws QueryException
query
- Description of Parameter
QueryException
- Description of Exceptionpublic void deleteAll(SQLQuery q) throws QueryException
q
- Description of Parameter
QueryException
- Description of Exceptionpublic java.util.Vector findAttributes(SQLQuery q, java.lang.String[] at) throws QueryException
q
- Description of Parameterat
- Description of Parameter
QueryException
- Description of Exceptionpublic Persistence findUnique(SQLQuery query) throws QueryException
query
- Description of Parameter
QueryException
- Description of Exceptionpublic void rollback() throws QueryException
QueryException
- Description of Exceptionpublic void save(Persistence obj) throws QueryException
obj
- Description of Parameter
QueryException
- Description of Exceptionpublic void saveObjects(java.util.ArrayList saveList) throws QueryException
saveList
- Description of Parameter
QueryException
- Description of Exceptionprotected void release(DbFile dbConnection) throws java.io.IOException
dbConnection
- Description of Parameter
java.io.IOException
- Description of Exceptionprotected java.lang.Object actualFind(DbFile file, SQLQuery query, Persistence p) throws java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
file
- Description of Parameterquery
- Description of Parameterp
- Description of Parameter
java.io.IOException
- Description of Exception
java.lang.InstantiationException
- Description of Exception
java.lang.IllegalAccessException
- Description of Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |