Created
December 7, 2016 17:12
-
-
Save thjanssen/132ace885883a7df4b252dfb1465dc71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@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