Servlets + JPA problem - error in annotation's "@Table"
Hello,
I have problem with entity file. Eclipse shows the error in the annotation @Table about "Table "component" cannot be resolved".
What I may doing?
My entity file:
Code:
@Entity
@Table(name="component") // Here is error: "Table "component" cannot be resolved"
public class ComponentEntity implements Serializable {
@Id
private int id;
private String symbol;
private String type;
private static final long serialVersionUID = 1L;
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getSymbol() {
return this.symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
}
File persistance.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="MyProject1">
<class>sj.entities.ComponentEntity</class>
</persistence-unit>
</persistence>
Help friends.
Re: Servlets + JPA problem - error in annotation's "@Table"