mirror of https://github.com/apache/openjpa.git
OPENJPA-485:
OPENJPA-497: Saving NPE git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@682570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
49d5f19a68
commit
b683569de0
|
@ -489,8 +489,10 @@ public class PCPath
|
|||
|
||||
for (; from != null && from != to;
|
||||
from = from.getJoinablePCSuperclassMapping()) {
|
||||
pstate.field = from.getFieldMapping(pstate.field
|
||||
.getName());
|
||||
FieldMapping cast = from.getFieldMapping(pstate.field
|
||||
.getName());
|
||||
if (cast != null)
|
||||
pstate.field = cast;
|
||||
pstate.joins = from.joinSuperclass(pstate.joins, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -322,9 +322,8 @@ public class QueryImpl implements OpenJPAQuerySPI, Serializable {
|
|||
if (expectedParamType.isPrimitive() && actualValue == null)
|
||||
newValidationException("param-type-null",
|
||||
position, query, expectedParamType.getName());
|
||||
if (actualValue == null)
|
||||
continue;
|
||||
if (!Filters.wrap(expectedParamType).isInstance(actualValue))
|
||||
if (actualValue != null &&
|
||||
!Filters.wrap(expectedParamType).isInstance(actualValue))
|
||||
newValidationException("param-type-mismatch",
|
||||
position, query, actualValue,
|
||||
actualValue.getClass().getName(),
|
||||
|
@ -347,8 +346,8 @@ public class QueryImpl implements OpenJPAQuerySPI, Serializable {
|
|||
if (expectedParamType.isPrimitive() && actualValue == null)
|
||||
newValidationException("param-type-null",
|
||||
position, query, expectedParamType.getName());
|
||||
if (!Filters.wrap(expectedParamType)
|
||||
.isInstance(actualValue))
|
||||
if (actualValue != null
|
||||
&& !Filters.wrap(expectedParamType).isInstance(actualValue))
|
||||
newValidationException("param-type-mismatch",
|
||||
position, query, actualValue,
|
||||
actualValue.getClass().getName(),
|
||||
|
@ -375,9 +374,8 @@ public class QueryImpl implements OpenJPAQuerySPI, Serializable {
|
|||
if (expectedParamType.isPrimitive() && actualValue == null)
|
||||
newValidationException("param-type-null",
|
||||
expectedName, query, expectedParamType.getName());
|
||||
if (actualValue == null)
|
||||
continue;
|
||||
if (!Filters.wrap(expectedParamType).isInstance(actualValue)) {
|
||||
if (actualValue != null
|
||||
&& !Filters.wrap(expectedParamType).isInstance(actualValue)) {
|
||||
newValidationException("param-type-mismatch",
|
||||
expectedName, query, actualValue,
|
||||
actualValue.getClass().getName(),
|
||||
|
@ -395,7 +393,8 @@ public class QueryImpl implements OpenJPAQuerySPI, Serializable {
|
|||
if (expectedParamType.isPrimitive() && actualValue == null)
|
||||
newValidationException("param-type-null",
|
||||
actualName, query, expectedParamType.getName());
|
||||
if (!Filters.wrap(expectedParamType).isInstance(actualValue)) {
|
||||
if (actualValue != null
|
||||
&& !Filters.wrap(expectedParamType).isInstance(actualValue)) {
|
||||
newValidationException("param-type-mismatch",
|
||||
actualName, query, actualValue,
|
||||
actualValue.getClass().getName(),
|
||||
|
|
Loading…
Reference in New Issue