Created
February 19, 2020 21:52
-
-
Save ljnelson/42d467d4e763be4e48396f0be91e1ce8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.helidon.example.jpa; | |
import java.io.Serializable; | |
import java.util.Objects; | |
import javax.persistence.Access; | |
import javax.persistence.AccessType; | |
import javax.persistence.Basic; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import javax.persistence.Table; | |
@Access(value = AccessType.FIELD) | |
@Entity(name = "Greeting") | |
@Table(name = "GREETING") | |
public class Greeting implements Serializable { | |
@Column( | |
insertable = true, | |
name = "SALUTATION", | |
nullable = false, | |
updatable = false | |
) | |
@Id | |
private String salutation; | |
@Basic(optional = false) | |
@Column( | |
insertable = true, | |
name = "RESPONSE", | |
nullable = false, | |
updatable = true | |
) | |
private String response; | |
@Deprecated | |
protected Greeting() { | |
super(); | |
} | |
public Greeting(String salutation, String response) { | |
super(); | |
this.salutation = Objects.requireNonNull(salutation); | |
this.setResponse(response); | |
} | |
public String getSalutation() { | |
return this.salutation; | |
} | |
public String getResponse() { | |
return this.response; | |
} | |
public void setResponse(String response) { | |
this.response = Objects.requireNonNull(response); | |
} | |
@Override | |
public String toString() { | |
return this.getSalutation() + " " + this.getResponse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment