Top Description Fields Constructors Methods
org.h2.engine

public Class MetaRecord

extends Object
implements Comparable<MetaRecord>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.sql.SQLException, java.util.Comparator, org.h2.api.DatabaseEventListener, org.h2.command.CommandInterface, .Prepared, org.h2.message.DbException, .Trace, org.h2.result.SearchRow, org.h2.value.ValueInteger, .ValueVarchar

A record in the system table of the database. It contains the SQL statement to create the database object.

Field Summary

Modifier and TypeField and Description
pack-priv static final Comparator<Prepared>
CONSTRAINTS_COMPARATOR

Comparator for prepared constraints, sorts unique and primary key constraints first.

private final int
private final int
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

-1, 0, or 1
compareTo
(MetaRecord
the other record
other
)

Implements java.lang.Comparable.compareTo.

Sort the list of meta records by 'create order'.

pack-priv static void
execute(Database
the database
db
,
Prepared
the prepared command
command
,
DatabaseEventListener
the database event listener
listener
,
String
SQL
sql
)

Execute the meta data statement.

private int

Returns:

the sort index
getCreateOrder
()

Get the sort order id for this object type.

public int
public int
public String
public static void
populateRowFromDBObject(DbObject
database object
obj
,
SearchRow
search row
r
)

Copy metadata from the specified object into specified search row.

pack-priv Prepared

Returns:

the prepared command
prepare
(Database
the database
db
,
SessionLocal
the system session
systemSession
,
DatabaseEventListener
the database event listener
listener
)

Prepares the meta data statement.

pack-priv void
prepareAndExecute(Database
the database
db
,
SessionLocal
the system session
systemSession
,
DatabaseEventListener
the database event listener
listener
)

Execute the meta data statement.

private static void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CONSTRAINTS_COMPARATORback to summary
pack-priv static final Comparator<Prepared> CONSTRAINTS_COMPARATOR

Comparator for prepared constraints, sorts unique and primary key constraints first.

idback to summary
private final int id
objectTypeback to summary
private final int objectType
sqlback to summary
private final String sql

Constructor Detail

MetaRecordback to summary
public MetaRecord(SearchRow r)

Method Detail

compareToback to summary
public int compareTo(MetaRecord other)

Implements java.lang.Comparable.compareTo.

Sort the list of meta records by 'create order'.

Parameters
other:MetaRecord

the other record

Returns:int

-1, 0, or 1

Annotations
@Override
executeback to summary
pack-priv static void execute(Database db, Prepared command, DatabaseEventListener listener, String sql)

Execute the meta data statement.

Parameters
db:Database

the database

command:Prepared

the prepared command

listener:DatabaseEventListener

the database event listener

sql:String

SQL

getCreateOrderback to summary
private int getCreateOrder()

Get the sort order id for this object type. Objects are created in this order when opening a database.

Returns:int

the sort index

getIdback to summary
public int getId()
getObjectTypeback to summary
public int getObjectType()
getSQLback to summary
public String getSQL()
populateRowFromDBObjectback to summary
public static void populateRowFromDBObject(DbObject obj, SearchRow r)

Copy metadata from the specified object into specified search row.

Parameters
obj:DbObject

database object

r:SearchRow

search row

prepareback to summary
pack-priv Prepared prepare(Database db, SessionLocal systemSession, DatabaseEventListener listener)

Prepares the meta data statement.

Parameters
db:Database

the database

systemSession:SessionLocal

the system session

listener:DatabaseEventListener

the database event listener

Returns:Prepared

the prepared command

prepareAndExecuteback to summary
pack-priv void prepareAndExecute(Database db, SessionLocal systemSession, DatabaseEventListener listener)

Execute the meta data statement.

Parameters
db:Database

the database

systemSession:SessionLocal

the system session

listener:DatabaseEventListener

the database event listener

throwExceptionback to summary
private static void throwException(Database db, DatabaseEventListener listener, DbException e, String sql)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override