I am using Eclipselink with Derby database to automatically generated a database from Entities.
The generation worked just fine at first, but when i added a User entity to my model and tried to generate tables from entities with JPA tools all the tables are generated except the User table & i get the following error during the generation
[EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "USER" at line 1, column 14.
Error Code: 30000
This is the user entity
@NamedQuery( name = "User.findByUsername", query = "SELECT u FROM User u WHERE u.username = :userneme AND u.password = :password" )
@Entity
public class User implements Serializable {
@Transient
private static final long serialVersionUID = 1L;
public User() {
super();
}
@Id
@GeneratedValue( strategy = GenerationType.AUTO )
private Integer id;
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername( String username ) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword( String password ) {
this.password = password;
}
Can anyone tell me why i am getting the exception ?
Thanks in advance