0

I am using @Entity to import data from database, this annotation in turn needs an id column, however my database doesn't have such a column (all other columns are spelled correctly)

@Entity
@Table(name = "my_table")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CashFlowTrainingData {

    @Column(name = "DATE")
    private LocalDate date;

    @Column(name = "SUMTYPE")
    private String sumType;

    @Column(name = "SUM")
    private Double sum;
}

What do I need to do?

I have tried to add:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

But the errors are:

SQL Error: 904, SQLState: 42000
ORA-00904: "C1_0"."ID": ???????????? ?????????????
oracle.jdbc.OracleDatabaseException: ORA-00904: "C1_0"."ID": ???????????? ?????????????
aled
  • 21,330
  • 3
  • 27
  • 34
  • Please remember to format errors as code. – aled Apr 25 '23 at 17:06
  • 1
    Does this answer your question? [ORA-00904: invalid identifier](https://stackoverflow.com/questions/6027961/ora-00904-invalid-identifier) – aled Apr 25 '23 at 17:07
  • I am a beginner in this, please do not be offended, but I really do not understand how that answer can solve my problem, since sql is considered there, and I only have Java and I do not know how to work with sql. Help( – Павлюченко Антон Apr 25 '23 at 18:10
  • 1
    That answer suggests that if the database column names were created with quotes it may cause that error. I suspect in your case it may be also related to non-english characters in the identifiers names. I'm sorry but if you are not familiar with the topics of the question (Oracle database and Java) then Stackoverflow may not be the appropriate place to help you. – aled Apr 25 '23 at 18:17

0 Answers0