Changeset 46fd0c7 for src/main/java/edu/gjoko/schedlr/entity/Business.java
- Timestamp:
- 03/13/23 00:58:07 (20 months ago)
- Branches:
- master
- Children:
- 9050790
- Parents:
- 2b0a4db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/entity/Business.java
r2b0a4db r46fd0c7 2 2 3 3 import com.fasterxml.jackson.annotation.JsonManagedReference; 4 import com.fasterxml.jackson.annotation.JsonProperty; 4 5 import lombok.AllArgsConstructor; 5 6 import lombok.Getter; 6 7 import lombok.NoArgsConstructor; 7 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; 8 12 9 13 import javax.persistence.*; … … 12 16 13 17 @Entity 18 @EntityListeners(AuditingEntityListener.class) 14 19 @Table(name = "business") 15 20 @Getter … … 23 28 private Long id; 24 29 25 @Column(name = " name")26 private String name;30 @Column(name = "company_name") 31 private String companyName; 27 32 28 33 @OneToOne 29 34 @JoinColumn(name = "business_type_id", referencedColumnName = "id") 35 @JsonProperty("businessType") 30 36 private BusinessType businessType; 31 37 32 @Column(name = "opening_time") 33 private LocalDateTime openingTime; 34 35 @Column(name = "closing_time") 36 private LocalDateTime closingTime; 37 38 @ManyToOne 38 @ManyToOne(cascade = CascadeType.PERSIST) 39 39 @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false) 40 @JsonProperty("owner") 40 41 private Stakeholder owner; 41 42 42 @OneToMany(mappedBy = "business" )43 @OneToMany(mappedBy = "business", cascade = CascadeType.PERSIST) 43 44 @JsonManagedReference 44 45 private List<Service> services; 45 46 47 @Column(name = "business_status") 48 @Enumerated(EnumType.STRING) 49 private BusinessStatus businessStatus; 50 46 51 @Column(name = "created") 52 @CreatedDate 47 53 private LocalDateTime created; 48 54 49 55 @Column(name = "modified") 56 @LastModifiedDate 50 57 private LocalDateTime modified; 51 58
Note:
See TracChangeset
for help on using the changeset viewer.