Last change
on this file was 77205be, checked in by gjoko kostadinov <gjokokostadinov@…>, 6 months ago |
Add entire code
|
-
Property mode
set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[a436340] | 1 | package edu.gjoko.schedlr.entity;
|
---|
| 2 |
|
---|
| 3 | import com.fasterxml.jackson.annotation.JsonBackReference;
|
---|
| 4 | import com.fasterxml.jackson.annotation.JsonIgnore;
|
---|
| 5 | import lombok.AllArgsConstructor;
|
---|
| 6 | import lombok.Getter;
|
---|
| 7 | import lombok.NoArgsConstructor;
|
---|
| 8 | import lombok.Setter;
|
---|
| 9 | import org.springframework.data.annotation.CreatedDate;
|
---|
| 10 | import org.springframework.data.annotation.LastModifiedDate;
|
---|
| 11 | import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
---|
| 12 |
|
---|
| 13 | import javax.persistence.*;
|
---|
| 14 | import java.time.LocalDateTime;
|
---|
| 15 |
|
---|
| 16 | @Entity
|
---|
| 17 | @EntityListeners(AuditingEntityListener.class)
|
---|
| 18 | @Table(name = "service_type")
|
---|
| 19 | @Getter
|
---|
| 20 | @Setter
|
---|
| 21 | @NoArgsConstructor
|
---|
| 22 | @AllArgsConstructor
|
---|
| 23 | public class ServiceType {
|
---|
| 24 |
|
---|
| 25 | @Id
|
---|
| 26 | @GeneratedValue(strategy = GenerationType.SEQUENCE)
|
---|
| 27 | private Long id;
|
---|
| 28 |
|
---|
| 29 | @Column(name = "name")
|
---|
| 30 | private String name;
|
---|
| 31 |
|
---|
| 32 | @ManyToOne
|
---|
| 33 | @JoinColumn(name = "business_type_id")
|
---|
| 34 | @JsonBackReference
|
---|
| 35 | private BusinessType businessType;
|
---|
| 36 |
|
---|
| 37 | @Column(name = "created")
|
---|
| 38 | @CreatedDate
|
---|
| 39 | @JsonIgnore
|
---|
| 40 | private LocalDateTime created;
|
---|
| 41 |
|
---|
| 42 | @Column(name = "modified")
|
---|
| 43 | @LastModifiedDate
|
---|
| 44 | @JsonIgnore
|
---|
| 45 | private LocalDateTime modified;
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.