org.apache.openjpa.jdbc.schema
Class Constraint

java.lang.Object
  extended by org.apache.openjpa.jdbc.schema.ReferenceCounter
      extended by org.apache.openjpa.jdbc.schema.Constraint
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ForeignKey, LocalConstraint

public abstract class Constraint
extends ReferenceCounter

A table constraint. This class is closely aligned with the constraint information available from DatabaseMetaData.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
Constraint()
          Default constructor.
Constraint(DBIdentifier name, Table table)
           
Constraint(String name, Table table)
          Deprecated.  
 
Method Summary
 DBIdentifier getColumnIdentifier()
           
 String getColumnName()
          Deprecated.  
 DBIdentifier getFullIdentifier()
           
 String getFullName()
          Deprecated.  
 DBIdentifier getIdentifier()
           
 String getName()
          Deprecated.  
 QualifiedDBIdentifier getQualifiedPath()
           
 DBIdentifier getSchemaIdentifier()
           
 String getSchemaName()
          Deprecated.  
 Table getTable()
          Return the table of this constraint.
 DBIdentifier getTableIdentifier()
           
 String getTableName()
          Deprecated.  
 boolean isDeferred()
          Return true if this is a deferred constraint.
abstract  boolean isLogical()
          Return whether this constraint is a logical constraint only; i.e.
(package private)  void remove()
          Called when the constraint is removed from the owning table.
 void setColumnIdentifier(DBIdentifier name)
           
 void setColumnName(String name)
          Deprecated.  
 void setDeferred(boolean deferred)
          Make this constrain deferred.
 void setIdentifier(DBIdentifier name)
           
 void setName(String name)
          Deprecated.  
 void setSchemaIdentifier(DBIdentifier schema)
           
 void setSchemaName(String schema)
          Deprecated.  
 void setTableIdentifier(DBIdentifier name)
           
 void setTableName(String name)
          Deprecated.  
 String 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

Constraint

Constraint()
Default constructor.


Constraint

Constraint(String name,
           Table table)
Deprecated. 

Constructor.

Parameters:
name - the name of the constraint, or null if none
table - the local table of the constraint

Constraint

Constraint(DBIdentifier name,
           Table table)
Method Detail

remove

void remove()
Called when the constraint is removed from the owning table. Invalidates the constraint.


getTable

public Table getTable()
Return the table of this constraint.


getTableName

public String getTableName()
Deprecated. 

Return the column's table name.


getTableIdentifier

public DBIdentifier getTableIdentifier()

setTableName

public void setTableName(String name)
Deprecated. 

Set the column's table name. You can only call this method on columns whose table object is not set.


setTableIdentifier

public void setTableIdentifier(DBIdentifier name)

getSchemaName

public String getSchemaName()
Deprecated. 

Return the column table's schema name.


getSchemaIdentifier

public DBIdentifier getSchemaIdentifier()

setSchemaName

public void setSchemaName(String schema)
Deprecated. 

Set the column table's schema name. You can only call this method on columns whose table object is not set.


setSchemaIdentifier

public void setSchemaIdentifier(DBIdentifier schema)

getColumnName

public String getColumnName()
Deprecated. 

Return the column's name.


getColumnIdentifier

public DBIdentifier getColumnIdentifier()

setColumnName

public void setColumnName(String name)
Deprecated. 

Set the column's name. You can only call this method on columns whose table object is not set.


setColumnIdentifier

public void setColumnIdentifier(DBIdentifier name)

getName

public String getName()
Deprecated. 

Return the name of the constraint.


getIdentifier

public DBIdentifier getIdentifier()

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.


setIdentifier

public void setIdentifier(DBIdentifier name)

getFullName

public String getFullName()
Deprecated. 

Return the full name of the constraint.


getQualifiedPath

public QualifiedDBIdentifier getQualifiedPath()

getFullIdentifier

public DBIdentifier getFullIdentifier()

isLogical

public abstract boolean isLogical()
Return whether this constraint is a logical constraint only; i.e. if it does not exist in the database.


isDeferred

public boolean isDeferred()
Return true if this is a deferred constraint.


setDeferred

public void setDeferred(boolean deferred)
Make this constrain deferred.


toString

public String toString()
Overrides:
toString in class Object


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