Ignore:
Timestamp:
12/26/23 18:50:43 (10 months ago)
Author:
gjoko kostadinov <gjokokostadinov@…>
Branches:
master
Children:
1413ee2
Parents:
950fa0d
Message:

Add entire code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/entity/Service.java

    • Property mode changed from 100644 to 100755
    r950fa0d r77205be  
    33import com.fasterxml.jackson.annotation.JsonBackReference;
    44import com.fasterxml.jackson.annotation.JsonIgnore;
     5import com.fasterxml.jackson.annotation.JsonManagedReference;
    56import lombok.AllArgsConstructor;
    67import lombok.Getter;
     
    1314import javax.persistence.*;
    1415import java.time.LocalDateTime;
     16import java.util.List;
    1517
    1618@Entity
     
    3335    private Integer price;
    3436
    35     @OneToOne(cascade = CascadeType.PERSIST)
     37    @Column(name = "cumulated_rating")
     38    private Float rating = 0.0f;
     39
     40    @Column(name = "reviews_count")
     41    private Integer reviewsCount = 0;
     42
     43    @OneToOne(cascade = CascadeType.MERGE)
    3644    @JoinColumn(name = "service_type_id", referencedColumnName = "id")
    3745    private ServiceType serviceType;
     
    3947    @ManyToOne
    4048    @JoinColumn(name = "business_id")
    41     @JsonBackReference
     49    @JsonBackReference(value = "services")
    4250    private Business business;
     51
     52    @OneToMany(mappedBy="service")
     53    @JsonManagedReference(value = "serviceAppointments")
     54    private List<Appointment> appointments;
    4355
    4456    @Column(name = "created")
Note: See TracChangeset for help on using the changeset viewer.