Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.dods.builder.generator.query
Class DataObjectException  view DataObjectException download DataObjectException.java

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.lutris.util.ChainedException
              extended bycom.lutris.dods.builder.generator.query.DataObjectException
All Implemented Interfaces:
com.lutris.util.ChainedThrowable, java.io.Serializable

public class DataObjectException
extends com.lutris.util.ChainedException

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.3.12.1 $

Nested Class Summary
 
Nested classes inherited from class java.lang.Throwable
 
Field Summary
 
Fields inherited from class com.lutris.util.ChainedException
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
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.
 
Methods inherited from class com.lutris.util.ChainedException
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.


DataObjectException

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