Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ActorInfo entity class from my blog post, 'Java RESTful Web Services Using MySQL Server, EclipseLink, and Jersey': http://wp.me/p1RD28-Cf
package com.mysql.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
@Entity
@Table(name = "actor_info")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ActorInfo.findAll", query = "SELECT a FROM ActorInfo a"),
@NamedQuery(name = "ActorInfo.findByActorId", query = "SELECT a FROM ActorInfo a WHERE a.actorId = :actorId"),
@NamedQuery(name = "ActorInfo.findByFirstName", query = "SELECT a FROM ActorInfo a WHERE a.firstName = :firstName"),
@NamedQuery(name = "ActorInfo.findByLastName", query = "SELECT a FROM ActorInfo a WHERE a.lastName = :lastName")})
public class ActorInfo implements Serializable {
private static final long serialVersionUID = 1L;
@Basic(optional = false)
@Column(name = "actor_id")
@Id
private short actorId;
@Basic(optional = false)
@Column(name = "first_name")
private String firstName;
@Basic(optional = false)
@Column(name = "last_name")
private String lastName;
@Lob
@Column(name = "film_info")
private String filmInfo;
public ActorInfo() {
}
public short getActorId() {
return actorId;
}
public void setActorId(short actorId) {
this.actorId = actorId;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFilmInfo() {
return filmInfo;
}
public void setFilmInfo(String filmInfo) {
this.filmInfo = filmInfo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.