Java Reference
In-Depth Information
@NamedQueries({@NamedQuery(name="FindByCatalogId", query="SELECT
OBJECT(a) FROM CatalogBean AS a WHERE a.catalogId = ?1"),
@NamedQuery(name="FindByJournal", query= "SELECT OBJECT(a) FROM
CatalogBean AS a WHERE a.journal= ?1 ")
})
The entity class declaration and the properties declarations are specified next.
public class
CatalogBean implements java.io.Serializable {
public CatalogBean(){} public CatalogBean
(
String catalogId
){
this.catalogId=catalogId;
}
private String catalogId;
private String journal;
private String publisher;
The id property is specified with the @Id annotation and the column is specified with
the @Column annotation. The getter/setter methods for the id property are
also specified.
@Id
@Column(name="CATALOGID", unique=true)
public String getCatalogId() {return catalogId;}
public void setCatalogId(String catalogId){this.
catalogId=catalogId;}
The getter/setter methods for the entity properties are specified next.
public String getJournal() {return journal;}
public void setJournal
(
String journal
){this.journal=journal;}
public String getPublisher() {return publisher;}
 
Search WWH ::




Custom Search