Ignore:
Timestamp:
10/18/22 00:50:33 (2 years ago)
Author:
Gjoko <goko_kostadinov@…>
Branches:
master
Children:
763289e
Parents:
401a211
Message:

Adding register customer functionality

Location:
src/main/java/edu/gjoko/schedlr/entity
Files:
3 edited

Legend:

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

    r401a211 r204464d  
    3535    private LocalDateTime closingTime;
    3636
    37     @OneToOne(cascade = CascadeType.ALL)
    38     @JoinColumn(name = "owner_id", referencedColumnName = "id")
     37    @ManyToOne
     38    @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
    3939    private Stakeholder owner;
    4040
  • src/main/java/edu/gjoko/schedlr/entity/Service.java

    r401a211 r204464d  
    55import lombok.NoArgsConstructor;
    66import lombok.Setter;
     7import org.springframework.data.annotation.CreatedDate;
     8import org.springframework.data.annotation.LastModifiedDate;
     9import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    710
    811import javax.persistence.*;
     12import java.sql.Timestamp;
     13import java.time.LocalDateTime;
    914
    1015@Entity
     16@EntityListeners(AuditingEntityListener.class)
    1117@Table(name = "service")
    1218@Getter
     
    3238    @JoinColumn(name = "business_id")
    3339    private Business business;
     40
     41    @Column(name = "created")
     42    @CreatedDate
     43    private LocalDateTime created;
     44
     45    @Column(name = "modified")
     46    @LastModifiedDate
     47    private LocalDateTime modified;
    3448}
  • src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java

    r401a211 r204464d  
    55import lombok.NoArgsConstructor;
    66import lombok.Setter;
     7import org.springframework.data.annotation.CreatedDate;
     8import org.springframework.data.annotation.LastModifiedDate;
     9import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    710
    811import javax.persistence.*;
     
    1013
    1114@Entity
     15@EntityListeners(AuditingEntityListener.class)
    1216@Table(name = "stakeholder")
    1317@Getter
     
    4145
    4246    @Column(name = "created")
     47    @CreatedDate
    4348    private LocalDateTime created;
    4449
    4550    @Column(name = "modified")
     51    @LastModifiedDate
    4652    private LocalDateTime modified;
    4753}
Note: See TracChangeset for help on using the changeset viewer.