Ignore:
Timestamp:
09/07/22 00:51:50 (2 years ago)
Author:
Marko <Marko@…>
Branches:
master
Children:
527b93f
Parents:
dbd4834
Message:

Edited registration and login services

Location:
phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/ConfirmationToken.java

    rdbd4834 rf25d07e  
    1313@Setter
    1414@NoArgsConstructor
    15 @Entity(name = "confirmation_tokens")
     15@Entity(name = "ConfirmationToken")
     16@Table(name = "confirmation_tokens")
    1617public class ConfirmationToken {
    1718
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/Phone.java

    rdbd4834 rf25d07e  
    2828    private String image_url;
    2929
     30    @Column(name = "total_offers")
     31    private Integer total_offers;
     32
     33    @Column(name = "lowest_price")
     34    private Integer lowestPrice;
     35
    3036    @OneToMany(fetch = FetchType.LAZY, mappedBy = "phone")
    3137    @JsonIgnore
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/PhoneOffer.java

    rdbd4834 rf25d07e  
    55
    66import javax.persistence.*;
     7import java.util.ArrayList;
    78import java.util.Date;
     9import java.util.List;
    810
    911@AllArgsConstructor
     
    7375    private String offer_shop_code;
    7476
     77    @ManyToMany(mappedBy = "favouriteOffers")
     78    private List<User> users = new ArrayList<User>();
     79
    7580    @ManyToOne(fetch = FetchType.LAZY)
    7681    @JoinColumn(name = "phone_id", referencedColumnName = "id")
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/User.java

    rdbd4834 rf25d07e  
    88
    99import javax.persistence.*;
     10import java.util.ArrayList;
    1011import java.util.Collection;
    1112import java.util.Collections;
     13import java.util.List;
    1214
    1315@Getter
     
    1618@NoArgsConstructor
    1719@AllArgsConstructor
    18 @Entity(name = "users")
     20@Entity(name = "User")
     21@Table(name = "users")
    1922public class User implements UserDetails {
    2023
     
    3841    private Boolean locked = false;
    3942    private Boolean enabled = false;
     43
     44    @ManyToMany
     45    @JoinTable(
     46            name = "users_favourite_offers",
     47            joinColumns = @JoinColumn(name = "user_id"),
     48            inverseJoinColumns = @JoinColumn(name = "offer_id")
     49    )
     50    private List<PhoneOffer> favouriteOffers = new ArrayList<PhoneOffer>();
    4051
    4152    public User(String firstName, String lastName, String email, String password, UserRole userRole) {
Note: See TracChangeset for help on using the changeset viewer.