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
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
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