|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.persist.DatabaseContainer
public class DatabaseContainer
The DatabaseContainer
class implements the Container
interface for a database. It therefore represents the information necessary
for allowing the persistence framework to operate against a database.
Constructor Summary | |
---|---|
DatabaseContainer(BbDatabase bbDatabase)
Constructor - creates a new DatabaseContainer object with the
given BbDatabase used to define the specifics of the data
source. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
Id |
generateId(DataType dataType,
int nKey1)
Generates an Id instance specific to this DatabaseContainer
. |
Id |
generateId(DataType dataType,
int nKey1,
int nKey2)
Generates an Id instance specific to this DatabaseContainer
. |
Id |
generateId(DataType dataType,
java.lang.String strKey)
Generates an Id instance specific to this DatabaseContainer . |
AppVersion |
getAppVersion()
Return the AppVersion |
BbDatabase |
getBbDatabase()
Returns the BbDatabase associated with this
DatabaseContainer . |
static DatabaseContainer |
getDefaultInstance()
Returns the default DatabaseContainer for the system. |
int |
hashCode()
|
boolean |
isValidId(Id id)
Determines if the provided Id is a "valid" id for this
DatabaseContainer . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseContainer(BbDatabase bbDatabase)
DatabaseContainer
object with the
given BbDatabase
used to define the specifics of the data
source.
bbDatabase
- the BbDatabase
to use in configuring this
container and the data source is should represent
java.lang.NullPointerException
- if database is nullMethod Detail |
---|
public AppVersion getAppVersion()
AppVersion associated with this DatabaseContainer
.
The AppVersion
returned is that contained within the
BbDatabase
provided at initialization time. This AppVersion
serves as a default AppVersion
for subsequent
calls into the persistence framework.
- Specified by:
getAppVersion
in interface Container
- Returns:
- the
AppVersion
defined for this container
public BbDatabase getBbDatabase()
BbDatabase
associated with this
DatabaseContainer
.
BbDatabase
associated with this database containerpublic static DatabaseContainer getDefaultInstance()
DatabaseContainer
for the system. This
container represents a database container instance configured to use the
default database connection information.
DatabaseContainer
as defined based upon
the default database configurationpublic Id generateId(DataType dataType, java.lang.String strKey) throws PersistenceException
Id
instance specific to this DatabaseContainer
.
The format of the provided string key value should be the same as
that generated by PkId.toExternalString()
.
generateId
in interface Container
dataType
- the DataType
of the object that the generated
Id
instance will refer tostrKey
- the String
value to use when generating the key value
of the Id
instance. Should be of tha same from as generated
by PkId.toExternalString()
Id
implementation instance, appropriate to this DatabaseContainer
, whose key value is generated from the given value
PersistenceException
- if an error occurs in the Id
generation processPkId.toExternalString()
public Id generateId(DataType dataType, int nKey1, int nKey2) throws PersistenceException
Id
instance specific to this DatabaseContainer
. The value of the provided integers does not matter, but, the
combination of the two values should be unique in order for the generated
Id
itself to be unique.
generateId
in interface Container
dataType
- the DataType
of the object that the generated
Id
instance will refer tonKey1
- an integer value to use when generating the key value of the
Id
instancenKey2
- another integer value to use when generating the key value of
the Id
instance
Id
implementation instance, appropriate to this DatabaseContainer
, whose key value is generated from the given
integer values
PersistenceException
- if an error occurs in the Id
generation processpublic Id generateId(DataType dataType, int nKey1) throws PersistenceException
Id
instance specific to this DatabaseContainer
. The value of the provided integers does not matter, but, the
combination of the two values should be unique in order for the generated
Id
itself to be unique.
generateId
in interface Container
dataType
- the DataType
of the object that the generated
Id
instance will refer tonKey1
- an integer value to use when generating the key value of the
Id
instance
Id
implementation instance, appropriate to this DatabaseContainer
, whose key value is generated from the given
integer values
PersistenceException
- if an error occurs in the Id
generation processpublic boolean isValidId(Id id)
Id
is a "valid" id for this
DatabaseContainer
.
Id
is considered valid for this DatabaseContainer
if it is "set" (see Id.isSet()
), if it originates from this
database container, and if it is an instance of the appropriate Id subclass
for this database container.
isValidId
in interface Container
id
- the Id
to examine for validity
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |