What are the possible errors that are causing this:
/home/api/target/generated-sources/annotations/org/example/core/user/model/User_.java:3:35
java: cannot find symbol
symbol: class Generated
location: package javax. annotation.processing
Where the User
object is:
import javax.persistence.*;
import java.sql.Timestamp;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int userId;
@Column(name = "username", nullable = false, unique = true)
private String username;
@Column(name = "password_hash")
private String passwords;
@Column(name = "google_id", unique = true)
private String googleId;
@Column(name = "email", nullable = false, unique = true)
private String email;
@ManyToOne
@JoinColumn(name = "subscription_id", nullable = false)
private Subscription subscription;
@Column(name = "created_at", nullable = false, updatable = false)
private Timestamp createdAt;
@Column(name = "updated_at", nullable = false)
private Timestamp updatedAt;
// Getters and Setters
}
The error happens when trying to build the project.
What could be wrong in the POM?
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>6.0.7</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-rdbms</artifactId>
<version>6.0.7</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>6.0.1</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa-query</artifactId>
<version>6.0.0-release</version>
</dependency>
Update:
After careful review I figured that the problem is with IntelliJ since using Maven build doesn’t throw this error.
I have tried to set the Global Settings but it won’t because of duplicated module:
2