private void handleXMLMarshalException(XMLMarshalException xmlException) throws IOException { if(xmlException.getErrorCode() == XMLMarshalException.NO_DESCRIPTOR_WITH_MATCHING_ROOT_ELEMENT || xmlException.getErrorCode() == XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT){ throw SDOException.globalPropertyNotFound(); } else if (xmlException.getCause() instanceof IOException) { throw (IOException) xmlException.getCause(); } else{ throw xmlException; } }
public static DatabaseException sqlException(SQLException exception, Call call, Accessor accessor, AbstractSession session, boolean isCommunicationFailure) { DatabaseException databaseException = new DatabaseException(exception); databaseException.setErrorCode(SQL_EXCEPTION); databaseException.setAccessor(accessor); databaseException.setCall(call); databaseException.setCommunicationFailure(isCommunicationFailure); return databaseException; }
/** * INTERNAL: * Require for cloning, the part must be cloned. */ public Object buildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { throw DescriptorException.invalidMappingOperation(this, "buildBackupCloneForPartObject"); }
/** * INTERNAL: * New parameter added to doesConform for feature 2612601 * @param objectIsUnregistered true if object possibly not a clone, but is being * conformed against the unit of work cache; if object is not in the UOW cache * but some of its attributes are, use the registered versions of * object's attributes for the purposes of this method. */ public boolean doesConform(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean objectIsUnregistered) throws QueryException { throw QueryException.cannotConformExpression(); }
/** * INTERNAL: * Prepare and execute the batch query and store the * results for each source object in a map keyed by the * mappings source keys of the source objects. */ protected void executeBatchQuery(DatabaseQuery query, CacheKey parentCacheKey, Map referenceObjectsByKey, AbstractSession session, AbstractRecord row) { throw QueryException.batchReadingNotSupported(this, query); }
/** * INTERNAL: * Used to allow object level comparisons. */ public Expression buildObjectJoinExpression(Expression base, Object value, AbstractSession session) { throw QueryException.unsupportedMappingForObjectComparison(this, base); }
/** * PUBLIC: * Returns the integrityChecker.IntegrityChecker holds all the ClassDescriptor Exceptions. */ @Override public IntegrityChecker getIntegrityChecker() { // BUG# 2700595 - Lazily create an IntegrityChecker if one has not already been created. if (integrityChecker == null) { integrityChecker = new IntegrityChecker(); } return integrityChecker; }
/** * PUBLIC: * This method is used for catching all the Descriptor Exceptions */ public void catchExceptions() { setShouldCatchExceptions(true); }
/** * PUBLIC: * This method is used to check the database tables. */ public void checkDatabase() { setShouldCheckDatabase(true); }
/** * INTERNAL: * TopLink exceptions should only be thrown by TopLink. */ protected SessionLoaderException(String message, Throwable internalException) { super(message); setInternalException(internalException); }
/** * INTERNAL: * Extract and return the appropriate value from the * specified remote value holder. */ public Object getValueFromRemoteValueHolder(RemoteValueHolder remoteValueHolder) { throw DescriptorException.invalidIndirectionPolicyOperation(this, "getValueFromRemoteValueHolder"); }
/** * ADVANCED: Return an expression representing a field in a data-level query. * This is used internally in EclipseLink, or to construct queries involving * fields and/or tables that are not mapped. * <p> Example: * <blockquote><pre> * builder.getField(aField).greaterThan(100); * </pre></blockquote> */ public Expression getField(DatabaseField field) { throw QueryException.illegalUseOfGetField(field); }
private void handleXMLMarshalException(XMLMarshalException xmlException) throws IOException { if(xmlException.getErrorCode() == XMLMarshalException.NO_DESCRIPTOR_WITH_MATCHING_ROOT_ELEMENT || xmlException.getErrorCode() == XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT){ throw SDOException.globalPropertyNotFound(); } else if (xmlException.getCause() instanceof IOException) { throw (IOException) xmlException.getCause(); } else{ throw xmlException; } }
/** * INTERNAL: * Builder the unit of work value holder. * @param buildDirectlyFromRow indicates that we are building the clone directly * from a row as opposed to building the original from the row, putting it in * the shared cache, and then cloning the original. */ public DatabaseValueHolder createCloneValueHolder(ValueHolderInterface attributeValue, Object original, Object clone, AbstractRecord row, AbstractSession cloningSession, boolean buildDirectlyFromRow) { throw DescriptorException.invalidMappingOperation(this, "createUnitOfWorkValueHolder"); }
/** * INTERNAL: * Return the value for in memory comparison. * This is only valid for valueable expressions. * New parameter added for feature 2612601 * @param isObjectUnregistered true if object possibly not a clone, but is being * conformed against the unit of work cache. */ public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered) { throw QueryException.cannotConformExpression(); }
/** * INTERNAL: * Extract the source primary key value from the target row. * Used for batch reading, most following same order and fields as in the mapping. * The method should be overridden by classes that support batch reading. */ protected Object extractKeyFromTargetRow(AbstractRecord row, AbstractSession session) { throw QueryException.batchReadingNotSupported(this, null); }
/** * ADVANCED: * This method is used to add an object to a collection once the changeSet is applied. * The referenceKey parameter should only be used for direct Maps. */ public void simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session) throws DescriptorException { throw DescriptorException.invalidMappingOperation(this, "simpleAddToCollectionChangeRecord"); }
/** * INTERNAL: * Add or removes a new value and its change set to the collection change record based on the event passed in. This is used by * attribute change tracking. */ public void updateCollectionChangeRecord(org.eclipse.persistence.descriptors.changetracking.CollectionChangeEvent event, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) throws DescriptorException { throw DescriptorException.invalidMappingOperation(this, "updateCollectionChangeRecord"); }
/** * INTERNAL: * Clone the attribute from the clone and assign it to the backup. */ public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork) { throw DescriptorException.invalidMappingOperation(this, "buildBackupClone"); }
/** * INTERNAL: * Merge changes from the source to the target object. */ @Override public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) { throw DescriptorException.invalidMappingOperation(this, "mergeChangesIntoObject"); }