'Invalid identifier on hibernate @Column different property name throws an error

Environment:

  • Java 11
  • Jboss 7.2
  • Hibernate 5.3.7

I have mapped a database field (USUARIMOD) with a different name property in java class (usuariupd) but when I try to query the table I get this error:

javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
...
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
...
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "OFERTAINSC0_"."USUARIUPD": identificador no válido
...

Any idea?

OfertaInscripcio

@Entity
@Table(name = "AF_OFE_OFERTA_INSCRIPCIO")
public class OfertaInscripcio
  ...
  @Column(name = "USUARIMOD")
  private String usuariUpd;
  ...


Solution 1:[1]

you can change the column value to lowercase.

example: Instead of using @Column(name = "USUARIMOD") you can use this @Column(name = "usuarumod")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mane alioune