Java Reference
In-Depth Information
By default, the id column of type INTEGER is mapped to a field of type long . Modify
the id field to type long , as IDs are usually a Java primitive data type. The entity
bean class is listed next:
package model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@Entity
@NamedQueries({
@NamedQuery(name = "Catalog.findAll",
query = "select o from Catalog o")
})
public class Catalog implements Serializable {
private String author;
private String edition;
private static final long serialVersionUID = 7422574264557894633L;
@Id
@Column(nullable = false)
private long id;
private String journal;
private String publisher;
private String title;
public Catalog() {super();
}
public Catalog(String author, String edition, long id,
String journal, String publisher, String title) {
super();
this.author = author;
this.edition = edition;
this.id = id;
this.journal = journal;
this.publisher = publisher;
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
 
Search WWH ::




Custom Search