Angular_Newbie
Angular_Newbie

Reputation: 417

Getting ORA-01722: invalid number in Spring Data query

I have two tables joined by non primary keys. This SQL query outputs 3 values as expected.

Its looking for the primary key of Department table. department2_.deptno Therefore I will try @EmbeddedId.

Upvotes: 0

Views: 2166

Answers (3)

Angular_Newbie
Angular_Newbie

Reputation: 417

The table didn't have a primary ID so I used ROWID as primary key and it worked.. JPA entity has no primary key?

Upvotes: 0

Vishrant
Vishrant

Reputation: 16628

If you are on UNIX/ LINUX operating system, then the table names in MySQL are case sensitive.

So I always recommend to have lower case table name for @Table(name = "<your_table>") and create table with lowercase letters in create query. Idea is to be consistent if your company have guidelines.

You can also make MySQL case insensitive follow this tutorial

Upvotes: 0

Samuel Alencar
Samuel Alencar

Reputation: 21

Try the following in the Where statement:

employee.emp_dept_code In(employee.department)

Update

you are trying to compare a number to varchar2 in where statement.

Upvotes: 1

Related Questions