Class MetaRecord
java.lang.Object
org.h2.engine.MetaRecord
- All Implemented Interfaces:
Comparable<MetaRecord>
A record in the system table of the database.
It contains the SQL statement to create the database object.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Comparator<Prepared> Comparator for prepared constraints, sorts unique and primary key constraints first.private final intprivate final intprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(MetaRecord other) Sort the list of meta records by 'create order'.(package private) static voidexecute(Database db, Prepared command, DatabaseEventListener listener, String sql) Execute the meta data statement.private intGet the sort order id for this object type.intgetId()intgetSQL()static voidpopulateRowFromDBObject(DbObject obj, SearchRow r) Copy metadata from the specified object into specified search row.(package private) Preparedprepare(Database db, SessionLocal systemSession, DatabaseEventListener listener) Prepares the meta data statement.(package private) voidprepareAndExecute(Database db, SessionLocal systemSession, DatabaseEventListener listener) Execute the meta data statement.private static voidthrowException(Database db, DatabaseEventListener listener, DbException e, String sql) toString()
-
Field Details
-
CONSTRAINTS_COMPARATOR
Comparator for prepared constraints, sorts unique and primary key constraints first. -
id
private final int id -
objectType
private final int objectType -
sql
-
-
Constructor Details
-
MetaRecord
-
-
Method Details
-
populateRowFromDBObject
-
prepareAndExecute
Execute the meta data statement.- Parameters:
db- the databasesystemSession- the system sessionlistener- the database event listener
-
prepare
Prepares the meta data statement.- Parameters:
db- the databasesystemSession- the system sessionlistener- the database event listener- Returns:
- the prepared command
-
execute
Execute the meta data statement.- Parameters:
db- the databasecommand- the prepared commandlistener- the database event listenersql- SQL
-
throwException
private static void throwException(Database db, DatabaseEventListener listener, DbException e, String sql) -
getId
public int getId() -
getObjectType
public int getObjectType() -
getSQL
-
compareTo
Sort the list of meta records by 'create order'.- Specified by:
compareToin interfaceComparable<MetaRecord>- Parameters:
other- the other record- Returns:
- -1, 0, or 1
-
getCreateOrder
private int getCreateOrder()Get the sort order id for this object type. Objects are created in this order when opening a database.- Returns:
- the sort index
-
toString
-