Java Reference
In-Depth Information
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@Entity
@NamedQueries( {
@NamedQuery(name = "findArticlesAll",
query = "select o from Article o"),
@NamedQuery(name = "findArticleById",
query = "SELECT o from Article o
WHERE o.id = :id") })
public class Article implements Serializable {
static final long serialVersionUID = 1;
private Section section;
private Edition edition;
@Column(length = 100)
private String author;
@Id
@Column(nullable = false, length = 100)
private String id;
@Column(length = 100)
private String title;
public Article() {
}
public Article(String author, String id, String title) {
this.author = author;
this.id = id;
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
@Id
@GeneratedValue
public String getId() {
return id;
}
 
Search WWH ::




Custom Search