You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to use @IdClass to handle composite keys and it is working fairly well on a single entity class. However, when using query bean to eagerly fetch the related entities, I ran into an error "ORA-00911: invalid character". The use case contains two classes Parent and Child.
I got the following error (after removing many other lines of the stacktrace). The query seemed to be correct except the order by phrase at the end "ORDER BY _idClass.key1 and _idClass.key2". The other old thing is that t0.key1 and t0.key2 appeared twice.
javax.persistence.PersistenceException: Query threw SQLException:ORA-00911: invalid character
Bind value:[123] Query was
SELECT
t0.key1,
t0.key2,
t0.key1,
t0.key2,
t1.key1,
t1.key2,
t1.name,
t1.age,
FROM
PARENT t0
LEFT JOIN CHILD t1
ON t1.key1 = t0.key1 AND t1.key1 = t0.key2
WHERE t0.key1 = ?
ORDER BY
_idClass.key1,
_idClass.key2
Caused by: Error : 911, Position : 749, sql = .... REPEATING THE QUERY ABOVE... , Error Msg = ORA-00911: invalid character
Thanks for your help.
Buck
The text was updated successfully, but these errors were encountered:
I am able to use @IdClass to handle composite keys and it is working fairly well on a single entity class. However, when using query bean to eagerly fetch the related entities, I ran into an error "ORA-00911: invalid character". The use case contains two classes Parent and Child.
The idClass for Parent has fields key1 and key2. The idClass for Child has fields key1, key2, name.
When I try to execute
I got the following error (after removing many other lines of the stacktrace). The query seemed to be correct except the order by phrase at the end "ORDER BY _idClass.key1 and _idClass.key2". The other old thing is that t0.key1 and t0.key2 appeared twice.
javax.persistence.PersistenceException: Query threw SQLException:ORA-00911: invalid character
Bind value:[123] Query was
SELECT
t0.key1,
t0.key2,
t0.key1,
t0.key2,
t1.key1,
t1.key2,
t1.name,
t1.age,
FROM
PARENT t0
LEFT JOIN CHILD t1
ON t1.key1 = t0.key1 AND t1.key1 = t0.key2
WHERE t0.key1 = ?
ORDER BY
_idClass.key1,
_idClass.key2
Caused by: Error : 911, Position : 749, sql = .... REPEATING THE QUERY ABOVE... , Error Msg = ORA-00911: invalid character
Thanks for your help.
Buck
The text was updated successfully, but these errors were encountered: