Changeset 46fd0c7 for src/main/java/edu/gjoko/schedlr/entity
- Timestamp:
- 03/13/23 00:58:07 (20 months ago)
- Branches:
- master
- Children:
- 9050790
- Parents:
- 2b0a4db
- Location:
- src/main/java/edu/gjoko/schedlr/entity
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/entity/Appointment.java
r2b0a4db r46fd0c7 5 5 import lombok.NoArgsConstructor; 6 6 import lombok.Setter; 7 import org.springframework.data.annotation.LastModifiedDate; 8 import org.springframework.data.jpa.domain.support.AuditingEntityListener; 7 9 8 10 import javax.persistence.*; … … 10 12 11 13 @Entity 14 @EntityListeners(AuditingEntityListener.class) 12 15 @Table(name = "appointment") 13 16 @Getter … … 31 34 32 35 @Column(name = "created") 36 @LastModifiedDate 33 37 private LocalDateTime created; 34 38 35 39 @Column(name = "modified") 40 @LastModifiedDate 36 41 private LocalDateTime modified; 37 42 } -
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 -
src/main/java/edu/gjoko/schedlr/entity/Service.java
r2b0a4db r46fd0c7 11 11 12 12 import javax.persistence.*; 13 import java.sql.Timestamp;14 13 import java.time.LocalDateTime; 15 14 … … 27 26 private Long id; 28 27 29 @Column(name = "name")30 private String name;31 32 28 @Column(name = "duration") 33 29 private Integer duration; 34 30 35 @Column(name = "price") 36 private Float price; 37 38 @OneToOne 31 @OneToOne(cascade = CascadeType.MERGE) 39 32 @JoinColumn(name = "service_type_id", referencedColumnName = "id") 40 33 private ServiceType serviceType; 41 34 42 35 @ManyToOne 43 @JoinColumn(name ="business_fk")36 @JoinColumn(name = "business_fk") 44 37 @JsonBackReference 45 38 private Business business;
Note:
See TracChangeset
for help on using the changeset viewer.