Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EODatabaseOperation


            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "Database error: " + e.getMessage());
View Full Code Here


            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              @SuppressWarnings("unchecked") NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "Database error: " + e.getMessage());
View Full Code Here

            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              @SuppressWarnings("unchecked") NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "Database error: " + e.getMessage());
View Full Code Here

        NSDictionary userInfo = e.userInfo();
        if(userInfo != null) {
            String eType = (String)userInfo.objectForKey(EOAdaptorChannel.AdaptorFailureKey);
            if (EOAdaptorChannel.AdaptorOptimisticLockingFailure.equals(eType)) {
                EOAdaptorOperation adaptorOp = (EOAdaptorOperation) userInfo.objectForKey(EOAdaptorChannel.FailedAdaptorOperationKey);
                EODatabaseOperation databaseOp = (EODatabaseOperation) userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                wasHandled = (adaptorOp != null && databaseOp != null);
            } else {
                log.error("Missing EOFailedAdaptorOperationKey or EOFailedDatabaseOperationKey in " + e + ": " + userInfo);
            }
        }
View Full Code Here

        return sourceAttributeForRelationship(relationship).columnName();
    }

    public static EOEnterpriseObject refetchFailedObject(EOEditingContext ec, EOGeneralAdaptorException e) {
        EOAdaptorOperation adaptorOp = (EOAdaptorOperation) e.userInfo().objectForKey(EOAdaptorChannel.FailedAdaptorOperationKey);
        EODatabaseOperation databaseOp = (EODatabaseOperation) e.userInfo().objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
        NSDictionary dbSnapshot = databaseOp.dbSnapshot();
        EOEntity entity = adaptorOp.entity();
        String entityName = entity.name();
        EOGlobalID gid = entity.globalIDForRow(dbSnapshot);
        EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
        // EOUtilities.databaseContextForModelNamed(ec, eo.entityName()).forgetSnapshotForGlobalID(gid);
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EODatabaseOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.