org.brains2b.data
Class DataException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.brains2b.data.DataException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CopyException

public class DataException
extends java.lang.Exception

Implementation of Exception for future use as default Exception in DataControl and DataController as replacement for the java.lang.Exception which is used in current versions.

Will be able to define the non specific data store errors by refering to a number only and will support multilanguage support in the future. The as CONSTANT defined error types will be added to. Therefor if you are going to use this, avoid the Numbers 0-9999.

Interface is not subject to change

Version:
0.20 [16-01-2008]
Author:
dennis@brains2b.nl
See Also:
Serialized Form

Field Summary
static int DELETE_FAILED
           
static int INSERT_FAILED
           
static int NO_PRIMARY_KEY
           
static int RECORD_CHANGED
           
static int RETRIEVE_FAILED
           
static int UPDATE_FAILED
           
 
Constructor Summary
DataException()
          Constructor for DataException.
DataException(int errorNo)
          Constructor
DataException(int errorNo, java.lang.Throwable cause)
          Constructor
DataException(java.lang.String message)
          Constructor for DataException.
DataException(java.lang.String message, java.lang.Throwable t)
          Constructor for DataException.
 
Method Summary
 int getErrorNo()
          get the error number for this Exception
 java.lang.String getMessage()
          get the Message for this Exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

RETRIEVE_FAILED

public static final int RETRIEVE_FAILED
See Also:
Constant Field Values

INSERT_FAILED

public static final int INSERT_FAILED
See Also:
Constant Field Values

UPDATE_FAILED

public static final int UPDATE_FAILED
See Also:
Constant Field Values

DELETE_FAILED

public static final int DELETE_FAILED
See Also:
Constant Field Values

RECORD_CHANGED

public static final int RECORD_CHANGED
See Also:
Constant Field Values

NO_PRIMARY_KEY

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

DataException

public DataException()
Constructor for DataException.


DataException

public DataException(int errorNo)
Constructor

Parameters:
errorNo - int, the errorNo for this Exception. in future releases all numbers will be implemented as CONSTANT. Avoid using numbers between 0-9999 for your own error messages.

DataException

public DataException(int errorNo,
                     java.lang.Throwable cause)
Constructor

Parameters:
errorNo - int, the errorNo for this Exception. in future releases all numbers will be implemented as CONSTANT. Avoid using numbers between 0-9999 for your own error messages.
cause - Throwable

DataException

public DataException(java.lang.String message)
Constructor for DataException.

Parameters:
message - String, the message for this Exception, for future multilanguage support use only the DataException(int) constructor

DataException

public DataException(java.lang.String message,
                     java.lang.Throwable t)
Constructor for DataException.

Parameters:
message - String, the message for this Exception, for future multilanguage support use only the DataException(int) constructor
cause - Throwable
Method Detail

getErrorNo

public int getErrorNo()
get the error number for this Exception

Returns:
int, the error number

getMessage

public java.lang.String getMessage()
get the Message for this Exception.

In future releases Exceptions which where created with an error number will lookup the appropriate message through a ResourceBundle implementation.

Overrides:
getMessage in class java.lang.Throwable
See Also:
Throwable.getMessage()