|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mathema.pride.DatabaseFactory
public class DatabaseFactory
Factory class to instantiate Database
objects. All
operations refer to a working context which can be switched
by the setContext function. Contexts are used to identify
multiple database access schemes, defined by a database name,
a resource accessor, and an exception listener. This allows
e.g. to serve multiple databases in an application or
different types of connections to one database.
RecordDescriptor
s may get passed a context identified
to express an association of an entity type to a particular
database access scheme. There is one Database
object
created by context. There is always at least one context
available by default which is identified by DEFAULT_CONTEXT.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_CONTEXT
|
static java.lang.String |
REVISION_ID
|
Method Summary | |
---|---|
static java.lang.String |
getContext()
Returns the name of the current database context |
static Database |
getDatabase()
Returns the Database instance of the current context |
static Database |
getDatabase(java.lang.String contextName)
Returns the Database instance of the specified context. |
static ResourceAccessor |
getResourceAccessor()
Returns the current context's ResourceAccessor |
static Database |
setContext(java.lang.String name)
Makes the specified context the current one and returns the context's Database instance. |
static void |
setDatabaseName(java.lang.String dbname)
Sets the database name for the current context to be used for Database instantiation in
getDatabase . |
static void |
setExceptionListener(ExceptionListener el)
Sets the ExceptionListener for the current context
to be used for Database instantiation in
getDatabase . |
static void |
setResourceAccessor(ResourceAccessor val)
Sets the current context's ResourceAccessor
to be used for Database instantiation in
getDatabase . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_CONTEXT
public static final java.lang.String REVISION_ID
Method Detail |
---|
public static void setResourceAccessor(ResourceAccessor val)
ResourceAccessor
to be used for Database
instantiation in
getDatabase
.
public static ResourceAccessor getResourceAccessor()
ResourceAccessor
public static void setDatabaseName(java.lang.String dbname)
Database
instantiation in
getDatabase
.
public static void setExceptionListener(ExceptionListener el)
ExceptionListener
for the current context
to be used for Database
instantiation in
getDatabase
.
public static Database getDatabase()
Database
instance of the current context
public static Database getDatabase(java.lang.String contextName)
Database
instance of the specified context.
contextName
- The context to refer to with public static Database setContext(java.lang.String name)
Database
instance. If the context doesn't exist yet, it is
created and the function returns null.
public static java.lang.String getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |