Skip to content

Commit

Permalink
Adding beer entity. closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
springframeworkguru committed May 17, 2019
1 parent fa9009e commit cb1012a
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package guru.springframework.msscbeerservice.domain;

import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.UUID;

/**
* Created by jt on 2019-05-17.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
public class Beer {

@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
@Column(length = 36, columnDefinition = "varchar", updatable = false, nullable = false)
private UUID id;

@Version
private Long version;

@CreationTimestamp
@Column(updatable = false)
private Timestamp createdDate;

@UpdateTimestamp
private Timestamp lastModifiedDate;

private String beerName;
private String beerStyle;

@Column(unique = true)
private Long upc;

private BigDecimal price;

private Integer minOnHand;
private Integer quantityToBrew;


}

0 comments on commit cb1012a

Please sign in to comment.