Top Description Fields Constructors Methods
org.h2.table

public Class TableSynonym

extends SchemaObject
Class Inheritance
Imports
org.h2.command.ddl.CreateSynonymData, org.h2.engine.SessionLocal, org.h2.message.DbException, .Trace, org.h2.schema.Schema, .SchemaObject, org.h2.util.ParserUtil

Synonym for an existing table or view. All DML requests are forwarded to the backing table. Adding indices to a synonym or altering the table is not supported.

Field Summary

Modifier and TypeField and Description
private CreateSynonymData
private Table
synonymFor

The table the synonym is created for.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Check if renaming is allowed.

public String
getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ...

public String
getCreateSQLForCopy(Table
the new table
table
,
String
the quoted name
quotedName
)

Overrides org.h2.engine.DbObject.getCreateSQLForCopy.

Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

public String
getDropSQL()

Overrides org.h2.engine.DbObject.getDropSQL.

Construct a DROP ...

public Table

Returns:

the table this is a synonym for
getSynonymFor
()

public String

Returns:

the table this synonym is for
getSynonymForName
()

public Schema

Returns:

the schema this synonym is for
getSynonymForSchema
()

public int
getType()

Implements abstract org.h2.engine.DbObject.getType.

Get the object type.

public boolean

Returns:

true if this synonym currently points to a real table
isInvalid
()

public void
removeChildrenAndResources(SessionLocal
the session
session
)

Implements abstract org.h2.engine.DbObject.removeChildrenAndResources.

Delete all dependent children objects and resources of this object.

public void
rename(String
the new name
newName
)

Overrides org.h2.engine.DbObject.rename.

Rename the object.

public void
updateData(CreateSynonymData
the new data
data
)

Set (update) the data.

public void
updateSynonymFor()

Update the table that this is a synonym for, to know about this synonym.

Inherited from org.h2.schema.SchemaObject:
getSchemagetSQLgetSQL

Field Detail

databack to summary
private CreateSynonymData data
synonymForback to summary
private Table synonymFor

The table the synonym is created for.

Constructor Detail

TableSynonymback to summary
public TableSynonym(CreateSynonymData data)

Method Detail

checkRenameback to summary
public void checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Doc from org.h2.engine.DbObject.checkRename.

Check if renaming is allowed. Does nothing when allowed.

Annotations
@Override
getCreateSQLback to summary
public String getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

Annotations
@Override
getCreateSQLForCopyback to summary
public String getCreateSQLForCopy(Table table, String quotedName)

Overrides org.h2.engine.DbObject.getCreateSQLForCopy.

Doc from org.h2.engine.DbObject.getCreateSQLForCopy.

Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

Parameters
table:Table

the new table

quotedName:String

the quoted name

Returns:String

the SQL statement

Annotations
@Override
getDropSQLback to summary
public String getDropSQL()

Overrides org.h2.engine.DbObject.getDropSQL.

Doc from org.h2.engine.DbObject.getDropSQL.

Construct a DROP ... SQL statement for this object.

Returns:String

the SQL statement

Annotations
@Override
getSynonymForback to summary
public Table getSynonymFor()
Returns:Table

the table this is a synonym for

getSynonymForNameback to summary
public String getSynonymForName()
Returns:String

the table this synonym is for

getSynonymForSchemaback to summary
public Schema getSynonymForSchema()
Returns:Schema

the schema this synonym is for

getTypeback to summary
public int getType()

Implements abstract org.h2.engine.DbObject.getType.

Doc from org.h2.engine.DbObject.getType.

Get the object type.

Returns:int

the object type

Annotations
@Override
isInvalidback to summary
public boolean isInvalid()
Returns:boolean

true if this synonym currently points to a real table

removeChildrenAndResourcesback to summary
public void removeChildrenAndResources(SessionLocal session)

Implements abstract org.h2.engine.DbObject.removeChildrenAndResources.

Doc from org.h2.engine.DbObject.removeChildrenAndResources.

Delete all dependent children objects and resources of this object.

Parameters
session:SessionLocal

the session

Annotations
@Override
renameback to summary
public void rename(String newName)

Overrides org.h2.engine.DbObject.rename.

Doc from org.h2.engine.DbObject.rename.

Rename the object.

Parameters
newName:String

the new name

Annotations
@Override
updateDataback to summary
public void updateData(CreateSynonymData data)

Set (update) the data.

Parameters
data:CreateSynonymData

the new data

updateSynonymForback to summary
public void updateSynonymFor()

Update the table that this is a synonym for, to know about this synonym.