0

I am Developing a back-end with Spring Boot: and I have to define my data models as Java entities and use annotations to map them to the corresponding database tables

But I keep getting an error when I try to add the annotations

here is my file class and the errore

   package com.java.filemanager.SpringReactFileManager.Entity;

import javax.persistence.*;

@Entity
@Table(name = "files")
public class File {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "file_name", nullable = false)
    private String fileName;

    @Column(name = "file_path", nullable = false)
    private String filePath;

    @ManyToOne
    @JoinColumn(name = "owner_id")
    private User owner;
    // Constructors, getters, and setters
}''''''

I added the dependencies for Gradle and even ran it in the build was successful enter image description here

Here is my application. properties.Im not sure if it is connected to the MySQL database and I'm not sure how to run and check to see if it is enter image description here

Tiya Allen
  • 27
  • 5
  • 1
    Please paste the code instead of images. As solution for your problem you might try to: replace imported javax with jakarta. See here: https://stackoverflow.com/questions/71179660/spring-boot-3-jakarta-and-javax – fascynacja Jun 09 '23 at 19:13

2 Answers2

0

The current problem seems to be a compile-time problem. You can first modify the problem corresponding to the code according to the error message in the lower left corner.

For example, adjust the file name SharedFileID.java to SharedFileId.java to match the class name.

0

replace imported javax with jakarta

Tiya Allen
  • 27
  • 5