org.apache.openjpa.jdbc.schema
Class Unique

java.lang.Object
  extended by org.apache.openjpa.jdbc.schema.ReferenceCounter
      extended by org.apache.openjpa.jdbc.schema.Constraint
          extended by org.apache.openjpa.jdbc.schema.LocalConstraint
              extended by org.apache.openjpa.jdbc.schema.Unique
All Implemented Interfaces:
Serializable

public class Unique
extends LocalConstraint

Represents a unique constraint. It can also represent a partial constraint.

Author:
Abe White, Pinaki Poddar
See Also:
Serialized Form

Constructor Summary
Unique()
           
Unique(DBIdentifier name, Table table)
           
Unique(String name, Table table)
          Deprecated.  
 
Method Summary
 boolean equalsUnique(Unique unq)
          Return true if the structure of this primary key matches that of the given one (same table, same columns).
 boolean isLogical()
          Return whether this constraint is a logical constraint only; i.e.
 void setIdentifier(DBIdentifier name)
           
 void setName(String name)
          Deprecated.  
 
Methods inherited from class org.apache.openjpa.jdbc.schema.LocalConstraint
addColumn, columnsMatch, containsColumn, derefColumns, equalsLocalConstraint, getColumns, refColumns, remove, removeColumn, setColumns
 
Methods inherited from class org.apache.openjpa.jdbc.schema.Constraint
getColumnIdentifier, getColumnName, getFullIdentifier, getFullName, getIdentifier, getName, getQualifiedPath, getSchemaIdentifier, getSchemaName, getTable, getTableIdentifier, getTableName, isDeferred, setColumnIdentifier, setColumnName, setDeferred, setSchemaIdentifier, setSchemaName, setTableIdentifier, setTableName, toString
 
Methods inherited from class org.apache.openjpa.jdbc.schema.ReferenceCounter
deref, getRefCount, ref
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Unique

public Unique()

Unique

public Unique(String name,
              Table table)
Deprecated. 

Construct with given name.

Parameters:
name - the name of the constraint, if any
table - the table of the constraint

Unique

public Unique(DBIdentifier name,
              Table table)
Method Detail

isLogical

public boolean isLogical()
Description copied from class: Constraint
Return whether this constraint is a logical constraint only; i.e. if it does not exist in the database.

Specified by:
isLogical in class Constraint

setName

public void setName(String name)
Deprecated. 

Set the name of the constraint. This method cannot be called if the constraint already belongs to a table.

Overrides:
setName in class Constraint

setIdentifier

public void setIdentifier(DBIdentifier name)
Overrides:
setIdentifier in class Constraint

equalsUnique

public boolean equalsUnique(Unique unq)
Return true if the structure of this primary key matches that of the given one (same table, same columns).



Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.