Skip to content

Instantly share code, notes, and snippets.

@thjanssen
Created December 7, 2016 17:12
Show Gist options
  • Save thjanssen/132ace885883a7df4b252dfb1465dc71 to your computer and use it in GitHub Desktop.
Save thjanssen/132ace885883a7df4b252dfb1465dc71 to your computer and use it in GitHub Desktop.
@Entity
public class Book implements Serializable {
@ManyToOne
@JoinColumn(name=”publisherid”)
private Publisher publisher;
public Optional getPublisher() {
return Optional.ofNullable(this.publisher);
}
public void setPublisher(final Publisher publisher) {
this.publisher = publisher;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment