org.opennms.netmgt.dao.db
Class Constraint

java.lang.Object
  extended by org.opennms.netmgt.dao.db.Constraint

public class Constraint
extends Object


Field Summary
static int CHECK
           
static int FOREIGN_KEY
           
static int PRIMARY_KEY
           
 
Constructor Summary
Constraint(String table, String constraint)
           
Constraint(String table, String name, List<String> columns)
          Construct a primary key constraint from it's required elements
Constraint(String table, String name, List<String> columns, String ftable, List<String> fcolumns, String fupdtype, String fdeltype)
          Construct a foreign key constraint from it's required elements
Constraint(String table, String name, String checkExpression)
          Construct a check type constraint from it's required elements
 
Method Summary
 boolean equals(Object other_o)
           
 boolean equals(Object other_o, boolean ignoreFdelType)
           
 String getCheckExpression()
           
 List<String> getColumns()
           
 List<String> getForeignColumns()
           
 String getForeignDelType()
           
 String getForeignTable()
           
 String getForeignUpdType()
           
 String getName()
           
 String getTable()
           
 int getType()
           
 int hashCode()
           
 boolean isCheckConstraint()
           
 boolean isForeignKeyConstraint()
           
 boolean isPrimaryKeyConstraint()
           
 void setCheckExpression(String expression)
           
 void setColumn(String column)
           
 void setColumns(List<String> columns)
           
 void setForeignColumn(String fcolumn)
           
 void setForeignColumns(List<String> fcolumns)
           
 void setForeignDelType(String fdeltype)
           
 void setForeignTable(String ftable)
           
 void setForeignUpdType(String fupdtype)
           
 void setName(String name)
           
 void setTable(String table)
           
 void setType(int type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIMARY_KEY

public static final int PRIMARY_KEY
See Also:
Constant Field Values

FOREIGN_KEY

public static final int FOREIGN_KEY
See Also:
Constant Field Values

CHECK

public static final int CHECK
See Also:
Constant Field Values
Constructor Detail

Constraint

public Constraint(String table,
                  String constraint)
           throws Exception
Throws:
Exception

Constraint

public Constraint(String table,
                  String name,
                  List<String> columns)
Construct a primary key constraint from it's required elements


Constraint

public Constraint(String table,
                  String name,
                  List<String> columns,
                  String ftable,
                  List<String> fcolumns,
                  String fupdtype,
                  String fdeltype)
           throws Exception
Construct a foreign key constraint from it's required elements

Throws:
Exception

Constraint

public Constraint(String table,
                  String name,
                  String checkExpression)
Construct a check type constraint from it's required elements

Method Detail

setForeignUpdType

public void setForeignUpdType(String fupdtype)

getForeignUpdType

public String getForeignUpdType()

getName

public String getName()

setName

public void setName(String name)

getType

public int getType()

setType

public void setType(int type)

isPrimaryKeyConstraint

public boolean isPrimaryKeyConstraint()

isForeignKeyConstraint

public boolean isForeignKeyConstraint()

isCheckConstraint

public boolean isCheckConstraint()

getTable

public String getTable()

setTable

public void setTable(String table)

setColumns

public void setColumns(List<String> columns)

getColumns

public List<String> getColumns()

setColumn

public void setColumn(String column)

getForeignTable

public String getForeignTable()

setForeignTable

public void setForeignTable(String ftable)

getForeignColumns

public List<String> getForeignColumns()

setForeignColumn

public void setForeignColumn(String fcolumn)

setForeignColumns

public void setForeignColumns(List<String> fcolumns)

getForeignDelType

public String getForeignDelType()

setForeignDelType

public void setForeignDelType(String fdeltype)
                       throws Exception
Throws:
Exception

getCheckExpression

public String getCheckExpression()

setCheckExpression

public void setCheckExpression(String expression)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other_o)
Overrides:
equals in class Object

equals

public boolean equals(Object other_o,
                      boolean ignoreFdelType)

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009. All Rights Reserved.