문제

I have this query

SELECT acc.Id 
  FROM Auth as auth, AccId as acc 
 WHERE acc.ownId.Id = auth.Id 
   AND acc.disabled = 0

Which appears to have been generated correctly:

org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "T1"."A_ID"."T1"."A_ID": invalid identifier

Obviously acc.ownId.Id was not generated properly.

How could this have happened?

도움이 되었습니까?

해결책

Please show your table definition, it makes it easier. Provide your table information and we can take a look at the create table clause.

acc.ownId.Id is wrong identifier for a column, if you dont put " " around it!

Check the correct column.

maybe

acc.ownId only? or acc."ownId.Id" ?

IF your column name was created as:

Create table AccId (
...
"ownId.Id" int,
...
);

It works, but I would not recommend this kind of naming.

Then of course you will need to wrapp it with " " if you use it in your query.

i.e.

WHERE acc."ownId.Id" = auth.Id

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top