Last active
June 17, 2016 04:10
-
-
Save thjanssen/b0c4a0ea387e5efc73f5be3cce1ed015 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
@Entity | |
@Immutable | |
public class BookView { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = "id", updatable = false, nullable = false) | |
private Long id; | |
@Version | |
@Column(name = "version") | |
private int version; | |
@Column | |
private String title; | |
@Column | |
@Temporal(TemporalType.DATE) | |
private Date publishingDate; | |
@Column | |
private String authors; | |
... | |
} |
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
List<BookView> bvs = em.createQuery("SELECT v FROM BookView v", BookView.class).getResultList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment