Skip to content

Instantly share code, notes, and snippets.

@Gwoks Gwoks/
Created Mar 17, 2018

What would you like to do?
package com.example.springbook.model;
import org.hibernate.validator.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import java.util.Date;
@Table(name = "books")
@JsonIgnoreProperties(value = {"createdAt", "updatedAt"}, allowGetters = true)
public class Buku implements Serializable{
@GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
private Long id;
private String titleBook;
private String namaDepanPengarang;
private String namaBelakangPengarang;
private int statusPeminjaman;
private String namaPeminjam;
@Column(nullable = false, updatable = false)
@Temporal (TemporalType.TIMESTAMP)
private Date createdAt;
@Column(nullable = false)
private Date updatedAt;
public Long getId() {
return id;
public String getTitleBook() {
return titleBook;
public String getNamaDepanPengarang() {
return namaDepanPengarang;
public String getNamaBelakangPengarang() {
return namaBelakangPengarang;
public int getStatusPeminjaman() {
return statusPeminjaman;
public String getNamaPeminjam() {
return namaPeminjam;
public Date getCreatedAt() {
return createdAt;
public Date getUpdatedAt() {
return updatedAt;
public void setId(Long id) { = id;
public void setTitleBook(String titleBook) {
this.titleBook = titleBook;
public void setNamaDepanPengarang(String namaDepanPengarang) {
this.namaDepanPengarang = namaDepanPengarang;
public void setNamaBelakangPengarang(String namaBelakangPengarang) {
this.namaBelakangPengarang = namaBelakangPengarang;
public void setStatusPeminjaman(int statusPeminjaman) {
this.statusPeminjaman = statusPeminjaman;
public void setNamaPeminjam(String namaPeminjam) {
this.namaPeminjam = namaPeminjam;
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.