Andrea Sindico
Andrea Sindico

Reputation: 7440

JPA Table Cannot Be Resolved

I have a JPA Entity like this:

@Entity
@Table(name = "USER", schema="APP")
public class User implements Serializable {

    @Id @GeneratedValue 
    private long id; 
    private String name;
    private static final long serialVersionUID = 1L;

    public User() {
        super();
    }   
    public String getName() {
        return this.name;
    }

    public void setName(String nam) {
        this.name = nam;
    }   


}

I try to generate the related table in this way: enter image description here

But I get this: enter image description here

I think this can be relevant:

enter image description here

I can't see why it creates a schema USER and a table SEQUENCE within it: enter image description here

Upvotes: 0

Views: 1695

Answers (1)

lexicore
lexicore

Reputation: 43651

Depending on the database, USER may be a reserved word. You seem to use Derby. It is a reserved word in Derby:

https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html.

Try naming your table differently.

Upvotes: 1

Related Questions