|
1 | 1 | /* |
2 | | - * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1998, 2025 Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * |
4 | 4 | * This program and the accompanying materials are made available under the |
5 | 5 | * terms of the Eclipse Public License v. 2.0 which is available at |
@@ -169,6 +169,7 @@ public class QueryException extends ValidationException { |
169 | 169 | public final static int UPDATE_ALL_QUERY_ADD_UPDATE_DEFINES_WRONG_FIELD = 6135; |
170 | 170 | public final static int POLYMORPHIC_REPORT_ITEM_NOT_SUPPORTED = 6136; |
171 | 171 | public final static int EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION = 6137; |
| 172 | + public final static int EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION_WRONG_TYPE = 6184; |
172 | 173 | public final static int TEMP_TABLES_NOT_SUPPORTED = 6138; |
173 | 174 | public final static int MAPPING_FOR_FIELDRESULT_NOT_FOUND = 6139; |
174 | 175 | public final static int JOIN_EXPRESSIONS_NOT_APPLICABLE_ON_NON_OBJECT_REPORT_ITEM = 6140; |
@@ -541,6 +542,18 @@ public static QueryException exceptionWhileUsingConstructorExpression(Exception |
541 | 542 | return queryException; |
542 | 543 | } |
543 | 544 |
|
| 545 | + /** |
| 546 | + * An exception was throwing while using a ReportQuery with a constructor expression and wrong type is passed to the constructor. |
| 547 | + */ |
| 548 | + public static QueryException exceptionWhileUsingConstructorWrongTypeExpression(Class<?> argumentType, DatabaseQuery query) { |
| 549 | + Object[] args = { argumentType.getName() }; |
| 550 | + |
| 551 | + QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION_WRONG_TYPE, args)); |
| 552 | + queryException.setErrorCode(EXCEPTION_WHILE_USING_CONSTRUCTOR_EXPRESSION_WRONG_TYPE); |
| 553 | + queryException.setQuery(query); |
| 554 | + return queryException; |
| 555 | + } |
| 556 | + |
544 | 557 | /** |
545 | 558 | * PUBLIC: |
546 | 559 | * Return the exception error message. |
|
0 commit comments