Last change
on this file since 9050790 was 46fd0c7, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 16 months ago |
Add admin page initial work.
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[cf9cdbf] | 1 | package edu.gjoko.schedlr.entity;
|
---|
| 2 |
|
---|
[a436340] | 3 | import com.fasterxml.jackson.annotation.JsonBackReference;
|
---|
[cf9cdbf] | 4 | import lombok.AllArgsConstructor;
|
---|
| 5 | import lombok.Getter;
|
---|
| 6 | import lombok.NoArgsConstructor;
|
---|
| 7 | import lombok.Setter;
|
---|
[204464d] | 8 | import org.springframework.data.annotation.CreatedDate;
|
---|
| 9 | import org.springframework.data.annotation.LastModifiedDate;
|
---|
| 10 | import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
---|
[cf9cdbf] | 11 |
|
---|
| 12 | import javax.persistence.*;
|
---|
[204464d] | 13 | import java.time.LocalDateTime;
|
---|
[cf9cdbf] | 14 |
|
---|
| 15 | @Entity
|
---|
[204464d] | 16 | @EntityListeners(AuditingEntityListener.class)
|
---|
[cf9cdbf] | 17 | @Table(name = "service")
|
---|
| 18 | @Getter
|
---|
| 19 | @Setter
|
---|
| 20 | @NoArgsConstructor
|
---|
| 21 | @AllArgsConstructor
|
---|
| 22 | public class Service {
|
---|
| 23 |
|
---|
| 24 | @Id
|
---|
| 25 | @GeneratedValue(strategy = GenerationType.SEQUENCE)
|
---|
| 26 | private Long id;
|
---|
| 27 |
|
---|
| 28 | @Column(name = "duration")
|
---|
| 29 | private Integer duration;
|
---|
| 30 |
|
---|
[46fd0c7] | 31 | @OneToOne(cascade = CascadeType.MERGE)
|
---|
[a436340] | 32 | @JoinColumn(name = "service_type_id", referencedColumnName = "id")
|
---|
| 33 | private ServiceType serviceType;
|
---|
| 34 |
|
---|
[cf9cdbf] | 35 | @ManyToOne
|
---|
[46fd0c7] | 36 | @JoinColumn(name = "business_fk")
|
---|
[a436340] | 37 | @JsonBackReference
|
---|
[cf9cdbf] | 38 | private Business business;
|
---|
[204464d] | 39 |
|
---|
| 40 | @Column(name = "created")
|
---|
| 41 | @CreatedDate
|
---|
| 42 | private LocalDateTime created;
|
---|
| 43 |
|
---|
| 44 | @Column(name = "modified")
|
---|
| 45 | @LastModifiedDate
|
---|
| 46 | private LocalDateTime modified;
|
---|
[cf9cdbf] | 47 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.