com.xavax.xstore
Class DatabaseMap

Object
  extended byPersistenceMap
      extended byDatabaseMap

public class DatabaseMap
extends PersistenceMap

DatabaseMap encapsulates the metadata which describes a database in a persistence environment and manages a pool of connections associated with the database. The metadata includes the database name, URL, username, password, locking style, and a collection of table identifiers.


Field Summary
static short LK_MSS
           
static short LK_MYSQL
           
static short LK_NONE
           
static short LK_ORACLE
           
 
Method Summary
 boolean contains(Vector v)
          Returns true if this database contains all tables listed in the specified vector.
 short databaseID()
          Returns the identifier for this database.
 boolean equals(Object o)
          Returns true if the specified database has the same identifier as this database.
 TableMap find(short id)
          Returns the table matching the specified table identifier if it exists in this database.
 TableMap find(Short key)
          Returns the table matching the specified key if it exists in this database.
 TableMap find(String name)
          Returns the table matching the specified name if it exists in this database.
 short lockStyle()
          Returns the locking style for this database.
 void outputXML(PrintWriter out)
          Output an XML representation of this database on the specified print writer.
 void show()
          Output a description of this database on stdout.
 String url()
          Returns the URL for this database.
 
Methods inherited from class PersistenceMap
hashCode, manager, name, toString
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LK_NONE

public static final short LK_NONE
See Also:
Constant Field Values

LK_MSS

public static final short LK_MSS
See Also:
Constant Field Values

LK_MYSQL

public static final short LK_MYSQL
See Also:
Constant Field Values

LK_ORACLE

public static final short LK_ORACLE
See Also:
Constant Field Values
Method Detail

contains

public boolean contains(Vector v)
Returns true if this database contains all tables listed in the specified vector.

Parameters:
v - the list of tables to check.
Returns:
true if this database contains all tables listed in a vector.

find

public TableMap find(String name)
Returns the table matching the specified name if it exists in this database.

Parameters:
name - the name of the table to find.
Returns:
the table matching the specified name.

find

public TableMap find(short id)
Returns the table matching the specified table identifier if it exists in this database.

Parameters:
id - the identifier of the table to be found.
Returns:
the table matching the specified name.

find

public TableMap find(Short key)
Returns the table matching the specified key if it exists in this database.

Parameters:
key - the key of the table to find.
Returns:
the table matching the specified name.

outputXML

public void outputXML(PrintWriter out)
Output an XML representation of this database on the specified print writer. Call the outputXML method for each TableMap.

Parameters:
out - the print writer to use for all output.

show

public void show()
Output a description of this database on stdout. Call the show method of each TableMap.


databaseID

public short databaseID()
Returns the identifier for this database.

Returns:
the identifier for this database.

lockStyle

public short lockStyle()
Returns the locking style for this database.

Returns:
the locking style for this database.

url

public String url()
Returns the URL for this database.

Returns:
the URL for this database.

equals

public boolean equals(Object o)
Returns true if the specified database has the same identifier as this database.

Returns:
true if the specified database has the same identifier as this database.