EAF 7.4 API

com.lutris.dods.builder.generator.query
Class DataObjectException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.enhydra.dods.exceptions.DodsBaseException
              extended by com.lutris.dods.builder.generator.query.DataObjectException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CacheObjectException

public class DataObjectException
extends DodsBaseException

DataObjectException class, used by Business Objects, catch all the DataObject Exceptions, will be passed to POs and handled there. Need to state the reasons.

Usage:

import myapp.business.*;

try {
some access of DOs
}
catch (SQLException sqlEx) {
if (sqlEx.getSQLState().startsWith("02") &&
(sqlEx.getErrorCode() == 100)) {
String msg = "Update or delete DO is out of synch";
throw new DataObjectException(msg, sqlEx);
}
else if (sqlEx.getSQLState().equals("S1000") &&
(sqlEx.getErrorCode() == -268)) {
String msg = "Integrity constraint violation";
throw new DataObjectException(msg, sqlEx);
}
else {
String msg = "Data Object Error";
throw new DataObjectException(msg, sqlEx);
}
}
catch (DatabaseManagerException connEx) {
String msg = "Database connection Error";
throw new DataObjectException(msg, connEx);
}
catch (ObjectIdException oidEx) {
String msg = "Object ID Error";
throw new DataObjectException(msg, oidEx);
}

Version:
$Revision: 1.1 $
See Also:
Serialized Form

Constructor Summary
DataObjectException(java.lang.String msg)
          Construct a exception without a specified cause.
DataObjectException(java.lang.String msg, java.lang.Throwable cause)
          Construct a exception with an associated causing exception.
 
Method Summary
 
Methods inherited from class org.enhydra.dods.exceptions.DodsBaseException
getCause, getMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataObjectException

public DataObjectException(java.lang.String msg)
Construct a exception without a specified cause.

Parameters:
msg - The message associated with the exception.

DataObjectException

public DataObjectException(java.lang.String msg,
                           java.lang.Throwable cause)
Construct a exception with an associated causing exception.

Parameters:
msg - The message associated with the exception.
cause - The error or exception that cause this exception.

EAF 7.4 API