Last change
on this file since 2b0a4db was a436340, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 17 months ago |
Adding customer registration
|
-
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.JsonIgnore;
|
---|
| 4 | import com.fasterxml.jackson.annotation.JsonManagedReference;
|
---|
| 5 | import com.fasterxml.jackson.annotation.JsonProperty;
|
---|
| 6 | import lombok.AllArgsConstructor;
|
---|
| 7 | import lombok.Getter;
|
---|
| 8 | import lombok.NoArgsConstructor;
|
---|
| 9 | import lombok.Setter;
|
---|
| 10 | import org.springframework.data.annotation.CreatedDate;
|
---|
| 11 | import org.springframework.data.annotation.LastModifiedDate;
|
---|
| 12 | import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
---|
| 13 |
|
---|
| 14 | import javax.persistence.*;
|
---|
| 15 | import java.time.LocalDateTime;
|
---|
| 16 | import java.util.List;
|
---|
| 17 |
|
---|
| 18 | @Entity
|
---|
| 19 | @EntityListeners(AuditingEntityListener.class)
|
---|
| 20 | @Table(name = "business_type")
|
---|
| 21 | @Getter
|
---|
| 22 | @Setter
|
---|
| 23 | @NoArgsConstructor
|
---|
| 24 | @AllArgsConstructor
|
---|
| 25 | public class BusinessType {
|
---|
| 26 |
|
---|
| 27 | @Id
|
---|
| 28 | @GeneratedValue(strategy = GenerationType.SEQUENCE)
|
---|
| 29 | @JsonProperty("value")
|
---|
| 30 | private Long id;
|
---|
| 31 |
|
---|
| 32 | @Column(name = "name")
|
---|
| 33 | @JsonProperty("text")
|
---|
| 34 | private String name;
|
---|
| 35 |
|
---|
| 36 | @OneToMany(mappedBy="businessType")
|
---|
| 37 | @JsonManagedReference
|
---|
| 38 | private List<ServiceType> serviceTypes;
|
---|
| 39 |
|
---|
| 40 | @Column(name = "created")
|
---|
| 41 | @CreatedDate
|
---|
| 42 | @JsonIgnore
|
---|
| 43 | private LocalDateTime created;
|
---|
| 44 |
|
---|
| 45 | @Column(name = "modified")
|
---|
| 46 | @LastModifiedDate
|
---|
| 47 | @JsonIgnore
|
---|
| 48 | private LocalDateTime modified;
|
---|
[cf9cdbf] | 49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.