org.metasyntactic.database.babel
Class Babel
java.lang.Object
|
+--org.metasyntactic.database.babel.Babel
- All Implemented Interfaces:
- BabelConstants
- public class Babel
- extends java.lang.Object
- implements BabelConstants
| Fields inherited from interface org.metasyntactic.database.babel.BabelConstants |
BOOLEAN_ARRAY, BYTE_ARRAY, CHAR_ARRAY, CLASS_DESCRIPTOR_TABLE, CLASS_DESCRIPTOR_TABLE_KEY, CLASS_TABLE, CLASS_TABLE_KEY, DOUBLE_ARRAY, FLOAT_ARRAY, INT_ARRAY, LONG_ARRAY, NULL_REFERENCE, OBJECT_ARRAY_TABLE, OBJECT_ARRAY_TABLE_KEY, OBJECT_TABLE, OBJECT_TABLE_FOREIGN_KEY, OBJECT_TABLE_KEY, PRIMITIVE_ARRAY_ELEMENT_SEPARATOR, PRIMITIVE_ARRAY_TABLE, PRIMITIVE_ARRAY_TABLE_KEY, SHORT_ARRAY, STRING_TABLE, STRING_TABLE_KEY |
|
Method Summary |
protected static void |
addTable(java.lang.String tableName)
|
protected static void |
addUsedKey(java.lang.String table,
int usedKey)
Declares that this key is now in use in the specified table |
protected static java.lang.String |
checkForReservedIdentifiers(java.lang.String id)
|
protected static int |
findUnusedKey(java.lang.String table,
java.lang.String keyColumn)
Checks keyColumn in table to find an unused key. |
protected static java.lang.String |
getKeyName(java.lang.String tableName)
|
protected static java.lang.String |
getTableName(java.lang.Class c)
|
protected static boolean |
hasTable(java.lang.String tableName)
|
static java.lang.Object |
load(int reference)
|
static void |
main(java.lang.String[] args)
|
protected static java.lang.String |
revertReservedIdentifiers(java.lang.String reserved)
|
static int |
save(java.lang.Object o)
|
static void |
start()
Initializes Babel's connection to the backing database |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objectToReference
protected static java.util.Map objectToReference
start
public static void start()
- Initializes Babel's connection to the backing database
save
public static int save(java.lang.Object o)
throws java.sql.SQLException
java.sql.SQLException
load
public static java.lang.Object load(int reference)
throws java.sql.SQLException,
java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
findUnusedKey
protected static int findUnusedKey(java.lang.String table,
java.lang.String keyColumn)
throws java.sql.SQLException
- Checks keyColumn in table to find an unused key. Key columns are
assumed to be INTEGERS. Returned keys will always be positive
java.sql.SQLException
addUsedKey
protected static void addUsedKey(java.lang.String table,
int usedKey)
- Declares that this key is now in use in the specified table
getTableName
protected static java.lang.String getTableName(java.lang.Class c)
getKeyName
protected static java.lang.String getKeyName(java.lang.String tableName)
checkForReservedIdentifiers
protected static java.lang.String checkForReservedIdentifiers(java.lang.String id)
revertReservedIdentifiers
protected static java.lang.String revertReservedIdentifiers(java.lang.String reserved)
hasTable
protected static boolean hasTable(java.lang.String tableName)
addTable
protected static void addTable(java.lang.String tableName)
main
public static void main(java.lang.String[] args)