Skip to content

BadSqlGrammarException is caused when using JSON-P JsonObject in Entity Class #1157

Closed
@TheStrixCoder

Description

@TheStrixCoder

My Entity Class is as follows:

@table(value = "VEHICLE_JSON")
public class VehicleJSON {
@id
private Long id;
@column("JSON_DATA_VEHICLE")
private javax.json.JsonObject jsonObject;
}

I am getting the exception:
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT "JSON_VALUE"."VALUE_TYPE" AS "VALUE_TYPE", "JSON_VALUE"."VEHICLE_JSON_KEY" AS "VEHICLE_JSON_KEY" FROM "JSON_VALUE" WHERE "JSON_VALUE"."JSON_DATA_VEHICLE" = ?]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

It works fine when using a POJO class to map the Database JSON column, but fails when using a generic JsonObject like JSON-P. It's considering JsonObject as a table.

I am using Oracle 21c database. I have attached the full stack trace for reference
stack.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions