Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ActorInfo entity class from my blog post, 'Java RESTful Web Services Using MySQL Server, EclipseLink, and Jersey':
package com.mysql.entities;
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;
@Table(name = "actor_info")
@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")
private short actorId;
@Basic(optional = false)
@Column(name = "first_name")
private String firstName;
@Basic(optional = false)
@Column(name = "last_name")
private String lastName;
@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