-
Notifications
You must be signed in to change notification settings - Fork 11
/
Campsite.java
60 lines (50 loc) · 1.36 KB
/
Campsite.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.kiroule.campsite.booking.api.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Generated;
import lombok.NoArgsConstructor;
/**
* Entity domain object representing a campsite.
*
* @author Igor Baiborodine
*/
@Entity
@Table(name = "campsites")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Generated
public class Campsite extends DateAudit {
/**
* Persistence ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EqualsAndHashCode.Include
private Long id;
/**
* Capacity, max number of people that campsite can accommodate
*/
@Column(name = "capacity", nullable = false)
private int capacity;
@Column(name = "restrooms", nullable = false)
private boolean restrooms;
@Column(name = "drinking_water", nullable = false)
private boolean drinkingWater;
@Column(name = "picnic_table", nullable = false)
private boolean picnicTable;
@Column(name = "fire_pit", nullable = false)
private boolean firePit;
@Column(name = "active", nullable = false)
private boolean active;
}