com.redhat.rhn.common.db
Class ConstraintViolationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.redhat.rhn.common.RhnRuntimeException
                  extended by com.redhat.rhn.common.db.DatabaseException
                      extended by com.redhat.rhn.common.db.ConstraintViolationException
All Implemented Interfaces:
java.io.Serializable

public class ConstraintViolationException
extends DatabaseException

Thrown when a DB constraint is violated

See Also:
Serialized Form

Field Summary
protected  java.lang.String constraint
           
protected  int constraintType
           
 
Constructor Summary
ConstraintViolationException(int type, java.lang.String name, java.lang.String message)
          Constructor
ConstraintViolationException(int type, java.lang.String name, java.lang.String message, java.lang.Throwable cause)
          Constructor
 
Method Summary
 java.lang.String getConstraint()
          Returns the value of constraint
 int getConstraintType()
          Returns the value of constraintType
 void setConstraint(java.lang.String name)
          Sets the constraint to the given value.
 void setConstraintType(int type)
          Sets the constraintType to the given value.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constraintType

protected int constraintType

constraint

protected java.lang.String constraint
Constructor Detail

ConstraintViolationException

public ConstraintViolationException(int type,
                                    java.lang.String name,
                                    java.lang.String message)
Constructor

Parameters:
type - constraint type
name - constraint name
message - exception message

ConstraintViolationException

public ConstraintViolationException(int type,
                                    java.lang.String name,
                                    java.lang.String message,
                                    java.lang.Throwable cause)
Constructor

Parameters:
type - constraint type
name - constraint name
message - exception message
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Method Detail

getConstraintType

public int getConstraintType()
Returns the value of constraintType

Returns:
int constraintType

setConstraintType

public void setConstraintType(int type)
Sets the constraintType to the given value.

Parameters:
type - constraint type

getConstraint

public java.lang.String getConstraint()
Returns the value of constraint

Returns:
String constraint

setConstraint

public void setConstraint(java.lang.String name)
Sets the constraint to the given value.

Parameters:
name - constraint name