Ignore:
Timestamp:
03/13/23 00:58:07 (20 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
9050790
Parents:
2b0a4db
Message:

Add admin page initial work.

File:
1 edited

Legend:

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

    r2b0a4db r46fd0c7  
    22
    33import com.fasterxml.jackson.annotation.JsonManagedReference;
     4import com.fasterxml.jackson.annotation.JsonProperty;
    45import lombok.AllArgsConstructor;
    56import lombok.Getter;
    67import lombok.NoArgsConstructor;
    78import lombok.Setter;
     9import org.springframework.data.annotation.CreatedDate;
     10import org.springframework.data.annotation.LastModifiedDate;
     11import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    812
    913import javax.persistence.*;
     
    1216
    1317@Entity
     18@EntityListeners(AuditingEntityListener.class)
    1419@Table(name = "business")
    1520@Getter
     
    2328    private Long id;
    2429
    25     @Column(name = "name")
    26     private String name;
     30    @Column(name = "company_name")
     31    private String companyName;
    2732
    2833    @OneToOne
    2934    @JoinColumn(name = "business_type_id", referencedColumnName = "id")
     35    @JsonProperty("businessType")
    3036    private BusinessType businessType;
    3137
    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)
    3939    @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
     40    @JsonProperty("owner")
    4041    private Stakeholder owner;
    4142
    42     @OneToMany(mappedBy = "business")
     43    @OneToMany(mappedBy = "business", cascade = CascadeType.PERSIST)
    4344    @JsonManagedReference
    4445    private List<Service> services;
    4546
     47    @Column(name = "business_status")
     48    @Enumerated(EnumType.STRING)
     49    private BusinessStatus businessStatus;
     50
    4651    @Column(name = "created")
     52    @CreatedDate
    4753    private LocalDateTime created;
    4854
    4955    @Column(name = "modified")
     56    @LastModifiedDate
    5057    private LocalDateTime modified;
    5158
Note: See TracChangeset for help on using the changeset viewer.