public static QueryException discriminatorColumnNotSelected(String expectedColumn, String sqlResultSetMapping){ Object[] args = { expectedColumn, sqlResultSetMapping }; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, DISCRIMINATOR_COLUMN_NOT_SELECTED, args)); queryException.setErrorCode(DISCRIMINATOR_COLUMN_NOT_SELECTED); return queryException; } /**
@Override public void addNamedInOutputArgument(String procedureParameterName, String argumentFieldName, Class type) { throw QueryException.addArgumentsNotSupported("named IN OUT arguments without DatabaseType classification"); }
/** * 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); }
/** * An exception was thrown while initializing the constructor from the class. */ public static QueryException exceptionWhileInitializingConstructor(Exception thrownException, DatabaseQuery query, Class targetClass) { Object[] args = { targetClass, thrownException }; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, EXCEPTION_WHILE_LOADING_CONSTRUCTOR, args)); queryException.setErrorCode(EXCEPTION_WHILE_LOADING_CONSTRUCTOR); queryException.setInternalException(thrownException); queryException.setQuery(query); return queryException; }
public static QueryException exceptionWhileReadingMapKey(Object object, Exception ex) { Object[] args = { object, ex }; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, EXCEPTION_WHILE_READING_MAP_KEY, args)); queryException.setErrorCode(EXCEPTION_WHILE_READING_MAP_KEY); queryException.setInternalException(ex); return queryException; }
public static QueryException cannotCacheCursorResultsOnQuery(DatabaseQuery query) { Object[] args = { }; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, CANNOT_CACHE_CURSOR_RESULTS_ON_QUERY, args)); queryException.setQuery(query); queryException.setErrorCode(CANNOT_CACHE_CURSOR_RESULTS_ON_QUERY); return queryException; }
throw QueryException.refreshNotPossibleWithoutCache(this); throw QueryException.cannotCachePartialObjects(this); throw QueryException.aggregateObjectCannotBeDeletedOrWritten(this.descriptor, this); throw QueryException.historicalQueriesMustPreserveGlobalCache(); } else if (!getSession().getPlatform().isOracle() && !getSession().getProject().hasGenericHistorySupport()) { throw QueryException.historicalQueriesOnlySupportedOnOracle(); throw QueryException.fetchGroupValidOnlyIfFetchGroupManagerInDescriptor(this.descriptor.getJavaClassName(), getName());
throw QueryException.referenceClassMissing(this); throw QueryException.descriptorIsMissing(referenceClass, this); throw QueryException.aggregateObjectCannotBeDeletedOrWritten(descriptor, this); throw QueryException.updateStatementsNotSpecified();
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } if (getDescriptor() == null) { ClassDescriptor referenceDescriptor = getSession().getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } getQueryMechanism().prepareDeleteAll(); }
throw QueryException.backupCloneIsDeleted(clone); throw QueryException.backupCloneIsOriginalFromParent(clone); throw QueryException.backupCloneIsOriginalFromSelf(clone);
Exception throwableException = exception.getException(); if (throwableException instanceof IllegalAccessException) { throw QueryException.cannotAccessMethodOnObject(keyMethod, keyElement); } else { throw QueryException.calledMethodThrewException(keyMethod, keyElement, throwableException); throw QueryException.cannotAccessMethodOnObject(keyMethod, keyElement); } catch (InvocationTargetException exception) { throw QueryException.calledMethodThrewException(keyMethod, keyElement, exception); return AccessController.doPrivileged(new PrivilegedGetValueFromField(keyField, keyElement)); } catch (PrivilegedActionException exception) { throw QueryException.cannotAccessFieldOnObject(keyField, keyElement); throw QueryException.cannotAccessFieldOnObject(keyField, keyElement);
if (!((CursoredStreamPolicy)this.policy).hasSizeQuery()) { if (this.query.isCallQuery()) { throw QueryException.additionalSizeQueryNotSpecified(this.query); throw QueryException.sizeOnlySupportedOnExpressionQueries(this.query); throw QueryException.incorrectSizeQueryForCursorStream(this.query);
throw QueryException.aggregateObjectCannotBeDeletedOrWritten(descriptor, this); exception.setQuery(this); throw exception;
/** * INTERNAL: * Prepare the receiver for execution in a session. * In particular check that the tables on the descriptor are set. */ protected void prepare() throws QueryException { checkDescriptor(this.session); if (this.object != null) {// Prepare can be called without the object set yet. this.object = this.descriptor.getObjectBuilder().unwrapObject(this.object, this.session); } if (this.descriptor.isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } super.prepare(); }
/** * INTERNAL: * Translate argumentValues into a database row. */ public AbstractRecord rowFromArguments(List argumentValues) throws QueryException { List<DatabaseField> argumentFields = this.argumentFields; // PERF: argumentFields are set in prepare, but need to be built if query is not prepared. if (!isPrepared() || (argumentFields == null)) { argumentFields = buildArgumentFields(); } if (argumentFields.size() != argumentValues.size()) { throw QueryException.argumentSizeMismatchInQueryAndQueryDefinition(this); } int argumentsSize = argumentFields.size(); AbstractRecord row = new DatabaseRecord(argumentsSize); for (int index = 0; index < argumentsSize; index++) { row.put(argumentFields.get(index), argumentValues.get(index)); } return row; }
throw QueryException.refreshNotPossibleWithoutCache(this); throw QueryException.cannotCachePartialObjects(this); throw QueryException.aggregateObjectCannotBeDeletedOrWritten(this.descriptor, this); throw QueryException.historicalQueriesMustPreserveGlobalCache(); } else if (!getSession().getPlatform().isOracle() && !getSession().getProject().hasGenericHistorySupport()) { throw QueryException.historicalQueriesOnlySupportedOnOracle();
throw QueryException.referenceClassMissing(this); throw QueryException.descriptorIsMissing(referenceClass, this); throw QueryException.aggregateObjectCannotBeDeletedOrWritten(descriptor, this); throw QueryException.updateStatementsNotSpecified();
/** * An exception was throwing while using a ReportQuery with a constructor expression */ public static QueryException exceptionWhileUsingConstructorExpression(Exception thrownException, DatabaseQuery query) { Object[] args = { thrownException }; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION, args)); queryException.setErrorCode(EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION); queryException.setInternalException(thrownException); queryException.setQuery(query); return queryException; }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } if (getDescriptor() == null) { ClassDescriptor referenceDescriptor = getSession().getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } if (getDescriptor().isAggregateDescriptor()) { throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this); } getQueryMechanism().prepareDeleteAll(); }
throw QueryException.backupCloneIsDeleted(clone); throw QueryException.backupCloneIsOriginalFromParent(clone); throw QueryException.backupCloneIsOriginalFromSelf(clone);