Package org.apache.openjpa.jdbc.schema
Class PrimaryKey
- java.lang.Object
-
- org.apache.openjpa.jdbc.schema.Constraint
-
- org.apache.openjpa.jdbc.schema.LocalConstraint
-
- org.apache.openjpa.jdbc.schema.PrimaryKey
-
- All Implemented Interfaces:
Serializable
public class PrimaryKey extends LocalConstraint
Represents a table primary key. It can also represent a partial key, aligning with the key information available fromDatabaseMetaData.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrimaryKey()Default constructor.PrimaryKey(String name, Table table)Deprecated.PrimaryKey(DBIdentifier name, Table table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(Column col)Add a column to the constraint.voidderef()booleanequalsPrimaryKey(PrimaryKey pk)Return true if the structure of this primary key matches that of the given one (same table, same columns).intgetRefCount()booleanisLogical()Return whether this constraint is a logical constraint only; i.e.voidref()voidsetLogical(boolean logical)-
Methods inherited from class org.apache.openjpa.jdbc.schema.LocalConstraint
columnsMatch, containsColumn, derefColumns, equalsLocalConstraint, getColumns, refColumns, removeColumn, setColumns
-
Methods inherited from class org.apache.openjpa.jdbc.schema.Constraint
equals, getColumnIdentifier, getColumnName, getFullIdentifier, getFullName, getIdentifier, getName, getQualifiedPath, getSchemaIdentifier, getSchemaName, getTable, getTableIdentifier, getTableName, hashCode, isDeferred, setColumnIdentifier, setColumnName, setDeferred, setIdentifier, setName, setSchemaIdentifier, setSchemaName, setTableIdentifier, setTableName, toString
-
-
-
-
Constructor Detail
-
PrimaryKey
public PrimaryKey()
Default constructor.
-
PrimaryKey
@Deprecated public PrimaryKey(String name, Table table)
Deprecated.Constructor.- Parameters:
name- the name of the primary key, if anytable- the table of the primary key
-
PrimaryKey
public PrimaryKey(DBIdentifier name, Table table)
-
-
Method Detail
-
isLogical
public boolean isLogical()
Description copied from class:ConstraintReturn whether this constraint is a logical constraint only; i.e. if it does not exist in the database.- Specified by:
isLogicalin classConstraint
-
setLogical
public void setLogical(boolean logical)
-
addColumn
public void addColumn(Column col)
Description copied from class:LocalConstraintAdd a column to the constraint.- Overrides:
addColumnin classLocalConstraint
-
equalsPrimaryKey
public boolean equalsPrimaryKey(PrimaryKey pk)
Return true if the structure of this primary key matches that of the given one (same table, same columns).
-
getRefCount
public int getRefCount()
-
ref
public void ref()
-
deref
public void deref()
-
-