SPT Object Database API

com.sptci.prevayler
Class ConstraintException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.sptci.prevayler.PrevalentException
              extended by com.sptci.prevayler.ConstraintException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DeleteException, NullException

public class ConstraintException
extends PrevalentException

An exception used to indicate that a constraint violations has been encountered while persisting the prevalent object.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: ConstraintException.java 4345 2008-06-30 21:22:03Z rakesh $
Author:
Rakesh Vidyadharan 2008-05-22
See Also:
Serialized Form

Field Summary
private static String FIELD_PATTERN
          The pattern for displaying constraint violation.
private static String OID_PATTERN
          The pattern used to generate the message for a oid violation.
private static long serialVersionUID
           
 
Constructor Summary
protected ConstraintException()
          Default constructor.
  ConstraintException(PrevalentObject object)
          Create a new instance of the exception using OID_PATTERN to display the message for the unique object id constraint being violated.
  ConstraintException(PrevalentObject object, String fields)
          Create a new instance of the exception using FIELD_PATTERN to display the message for unique constraint on specified fields being violated.
  ConstraintException(String message)
          Create a new instance of the exception with the specified message.
 
Method Summary
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

FIELD_PATTERN

private static final String FIELD_PATTERN
The pattern for displaying constraint violation.

See Also:
Constant Field Values

OID_PATTERN

private static final String OID_PATTERN
The pattern used to generate the message for a oid violation.

See Also:
Constant Field Values
Constructor Detail

ConstraintException

protected ConstraintException()
Default constructor. Cannot be instantiated.


ConstraintException

public ConstraintException(String message)
Create a new instance of the exception with the specified message.

Parameters:
message - The message to associate with the exception.

ConstraintException

public ConstraintException(PrevalentObject object,
                           String fields)
Create a new instance of the exception using FIELD_PATTERN to display the message for unique constraint on specified fields being violated.

Parameters:
object - The prevalent object for which the violation was raised.
fields - A string representing the fields on which the constraint was defined.

ConstraintException

public ConstraintException(PrevalentObject object)
Create a new instance of the exception using OID_PATTERN to display the message for the unique object id constraint being violated.

Parameters:
object - The prevalent object for which the violation was raised.

SPT Object Database API