Ignore:
Timestamp:
01/04/23 02:49:26 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
ab952ab
Parents:
6832924
Message:

Configured spring security, changed spring version

Location:
src/main/java/com/example/autopartz/model
Files:
1 added
25 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/model/Administrator.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.Setter;
     5import lombok.ToString;
    56import org.hibernate.Hibernate;
     7import org.springframework.security.core.GrantedAuthority;
    68
     9import javax.persistence.Entity;
    710import java.time.LocalDate;
     11import java.util.Collection;
     12import java.util.Collections;
    813import java.util.Objects;
    914
     
    2934        return getClass().hashCode();
    3035    }
     36
     37    @Override
     38    public Collection<? extends GrantedAuthority> getAuthorities() {
     39        return Collections.singletonList(Role.ROLE_ADMIN);
     40    }
    3141}
  • src/main/java/com/example/autopartz/model/Car.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.util.Objects;
    811
     
    1518public class Car {
    1619    @Id
    17     Long ID_car;
     20    Integer ID_car;
    1821    Integer in_production_since;
    1922    Integer in_production_till;
  • src/main/java/com/example/autopartz/model/CarManufacturer.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.Table;
    6 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    77import org.hibernate.Hibernate;
    88
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.Table;
    912import java.util.Objects;
    1013
     
    1720public class CarManufacturer {
    1821    @Id
    19     Long ID_car_manufacturer;
     22    Integer ID_car_manufacturer;
    2023    String cm_name;
    2124    String cm_country;
  • src/main/java/com/example/autopartz/model/CarSample.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.util.Objects;
    811
  • src/main/java/com/example/autopartz/model/Category.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.util.Objects;
    811
     
    1417public class Category {
    1518    @Id
    16     Long ID_category;
     19    Integer ID_category;
    1720    @Column(name = "category_name")
    1821    String cname;
  • src/main/java/com/example/autopartz/model/Client.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
     8import org.springframework.security.core.GrantedAuthority;
    69
     10import javax.persistence.Entity;
     11import java.util.Collection;
     12import java.util.Collections;
    713import java.util.Objects;
    814
     
    2531        return getClass().hashCode();
    2632    }
     33    @Override
     34    public Collection<? extends GrantedAuthority> getAuthorities() {
     35        return Collections.singletonList(Role.ROLE_CLIENT);
     36    }
    2737}
  • src/main/java/com/example/autopartz/model/Delivery.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.util.Objects;
    811
     
    1417public class Delivery {
    1518    @Id
    16     Long ID_delivery;
     19    Integer ID_delivery;
    1720    String delivery_status;
    1821    String delivery_address;
  • src/main/java/com/example/autopartz/model/Deliveryman.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Table;
    5 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    67import org.hibernate.Hibernate;
     8import org.springframework.security.core.GrantedAuthority;
    79
     10import javax.persistence.Entity;
     11import javax.persistence.Table;
    812import java.time.LocalDate;
     13import java.util.Collection;
     14import java.util.Collections;
    915import java.util.Objects;
    1016
     
    3036        return getClass().hashCode();
    3137    }
     38    @Override
     39    public Collection<? extends GrantedAuthority> getAuthorities() {
     40        return Collections.singletonList(Role.ROLE_DELIVERYMAN);
     41    }
    3242}
  • src/main/java/com/example/autopartz/model/Order.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.time.LocalDateTime;
    811import java.util.List;
     
    1720public class Order {
    1821    @Id
    19     Long ID_order;
     22    Integer ID_order;
    2023    String order_status;
    2124    LocalDateTime order_date;
  • src/main/java/com/example/autopartz/model/Part.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    43import lombok.Getter;
    54import lombok.RequiredArgsConstructor;
     
    87import org.hibernate.Hibernate;
    98
     9import javax.persistence.*;
    1010import java.util.List;
    1111import java.util.Objects;
     
    1919    @Id
    2020    @Column(name = "ID_part")
    21     Long id;
     21    Integer id;
    2222    @Column(name = "part_name")
    2323    String name;
  • src/main/java/com/example/autopartz/model/PartManufacturer.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Column;
    4 import jakarta.persistence.Entity;
    5 import jakarta.persistence.Id;
    6 import jakarta.persistence.Table;
    7 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    87import org.hibernate.Hibernate;
    98
     9import javax.persistence.Column;
     10import javax.persistence.Entity;
     11import javax.persistence.Id;
     12import javax.persistence.Table;
    1013import java.util.Objects;
    1114
     
    1821public class PartManufacturer {
    1922    @Id
    20     Long ID_part_manufacturer;
     23    Integer ID_part_manufacturer;
    2124    @Column(name = "pm_name")
    2225    String name;
  • src/main/java/com/example/autopartz/model/Price.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.JoinColumn;
    6 import jakarta.persistence.ManyToOne;
    7 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    87import org.hibernate.Hibernate;
    98
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.JoinColumn;
     12import javax.persistence.ManyToOne;
    1013import java.time.LocalDate;
    1114import java.util.Objects;
     
    1821public class Price {
    1922    @Id
    20     Long ID_price;
     23    Integer ID_price;
    2124    Integer amount;
    2225    LocalDate price_from;
  • src/main/java/com/example/autopartz/model/Repair.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.JoinColumn;
    6 import jakarta.persistence.ManyToOne;
    7 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    87import org.hibernate.Hibernate;
    98
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.JoinColumn;
     12import javax.persistence.ManyToOne;
    1013import java.util.Objects;
    1114
     
    1720public class Repair {
    1821    @Id
    19     Long ID_repair;
     22    Integer ID_repair;
    2023    @ManyToOne
    2124    @JoinColumn(name = "vin")
  • src/main/java/com/example/autopartz/model/RepairShop.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.util.List;
    811import java.util.Objects;
     
    1720    @Id
    1821    @Column(name = "ID_repair_shop")
    19     Long id;
     22    Integer id;
    2023    @Column(name = "rs_name")
    2124    String name;
  • src/main/java/com/example/autopartz/model/Review.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.JoinColumn;
    6 import jakarta.persistence.ManyToOne;
    7 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    87import org.hibernate.Hibernate;
    98
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.JoinColumn;
     12import javax.persistence.ManyToOne;
    1013import java.util.Objects;
    1114
     
    1720public class Review {
    1821    @Id
    19     Long ID_review;
     22    Integer ID_review;
    2023    Integer review_rating;
    2124    String review_comment;
  • src/main/java/com/example/autopartz/model/ServiceBook.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
    68
     9import javax.persistence.*;
    710import java.time.LocalDateTime;
    811import java.util.Objects;
     
    1619public class ServiceBook {
    1720    @Id
    18     Long ID_service_book;
     21    Integer ID_service_book;
    1922    LocalDateTime sb_created_on;
    2023    @OneToOne
  • src/main/java/com/example/autopartz/model/User.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.*;
    4 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    57import org.hibernate.Hibernate;
     8import org.springframework.security.core.GrantedAuthority;
     9import org.springframework.security.core.userdetails.UserDetails;
    610
     11import javax.persistence.*;
    712import java.time.LocalDateTime;
     13import java.util.Collection;
     14import java.util.Collections;
    815import java.util.Objects;
    916
     
    1522@Table(name = "users_table")
    1623@Inheritance(strategy = InheritanceType.JOINED)
    17 public class User {
     24public class User implements UserDetails {
    1825    @Id
    19     Long ID_user;
     26    Integer ID_user;
    2027    String username;
    2128    String email;
     
    5057        return getClass().hashCode();
    5158    }
     59
     60
     61    @Override
     62    public Collection<? extends GrantedAuthority> getAuthorities() {
     63        return Collections.singletonList(Role.ROLE_USER);
     64    }
     65
     66    @Override
     67    public boolean isAccountNonExpired() {
     68        return true;
     69    }
     70
     71    @Override
     72    public boolean isAccountNonLocked() {
     73        return true;
     74    }
     75
     76    @Override
     77    public boolean isCredentialsNonExpired() {
     78        return true;
     79    }
     80
     81    @Override
     82    public boolean isEnabled() {
     83        return true;
     84    }
    5285}
  • src/main/java/com/example/autopartz/model/Warehouse.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    67import org.hibernate.Hibernate;
    78
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
    811import java.util.Objects;
    912
     
    1518public class Warehouse {
    1619    @Id
    17     Long ID_warehouse;
     20    Integer ID_warehouse;
    1821    String warehouse_location;
    1922
  • src/main/java/com/example/autopartz/model/Warehouseman.java

    r6832924 rae042f4  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.JoinColumn;
    5 import jakarta.persistence.ManyToOne;
    6 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    77import org.hibernate.Hibernate;
     8import org.springframework.security.core.GrantedAuthority;
    89
     10import javax.persistence.Entity;
     11import javax.persistence.JoinColumn;
     12import javax.persistence.ManyToOne;
    913import java.time.LocalDate;
     14import java.util.Collection;
     15import java.util.Collections;
    1016import java.util.Objects;
    1117
     
    3339        return getClass().hashCode();
    3440    }
     41    @Override
     42    public Collection<? extends GrantedAuthority> getAuthorities() {
     43        return Collections.singletonList(Role.ROLE_WAREHOUSEMAN);
     44    }
    3545}
  • src/main/java/com/example/autopartz/model/views/OrdersForUser.java

    r6832924 rae042f4  
    11package com.example.autopartz.model.views;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.IdClass;
    6 import jakarta.persistence.Table;
    7 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    87import org.hibernate.annotations.Immutable;
    98
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.IdClass;
     12import javax.persistence.Table;
    1013import java.io.Serial;
    1114import java.io.Serializable;
     
    2528    private static final long serialVersionUID = 1L;
    2629    @Id
    27     Long userid;
     30    Integer userid;
    2831    @Id
    2932    LocalDateTime orderdate;
  • src/main/java/com/example/autopartz/model/views/OrdersForUserId.java

    r6832924 rae042f4  
    88@Data
    99public class OrdersForUserId implements Serializable {
    10     Long userid;
     10    Integer userid;
    1111    LocalDateTime orderdate;
    1212    String partname;
  • src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java

    r6832924 rae042f4  
    11package com.example.autopartz.model.views;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.Table;
    6 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    77import org.hibernate.annotations.Immutable;
    88
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.Table;
    912import java.io.Serial;
    1013import java.io.Serializable;
     
    2124    private static final long serialVersionUID = 1L;
    2225    @Id
    23     Long partid;
     26    Integer partid;
    2427    String partname;
    2528    String cartype;
  • src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java

    r6832924 rae042f4  
    11package com.example.autopartz.model.views;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.Table;
    6 import lombok.*;
     3import lombok.Getter;
     4import lombok.RequiredArgsConstructor;
     5import lombok.Setter;
     6import lombok.ToString;
    77import org.hibernate.Hibernate;
    88import org.hibernate.annotations.Immutable;
    99
     10import javax.persistence.Entity;
     11import javax.persistence.Id;
     12import javax.persistence.Table;
    1013import java.io.Serial;
    1114import java.io.Serializable;
     
    2427    private static final long serialVersionUID = 1L;
    2528    @Id
    26     Long rsid;
     29    Integer rsid;
    2730    String rsname;
    28     Integer reviewcount;
     31    Long reviewcount;
    2932    Float reviewaverage;
    3033
  • src/main/java/com/example/autopartz/model/views/RepairsForUser.java

    r6832924 rae042f4  
    11package com.example.autopartz.model.views;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.IdClass;
    6 import jakarta.persistence.Table;
    73import lombok.Getter;
    84import lombok.RequiredArgsConstructor;
     
    117import org.hibernate.annotations.Immutable;
    128
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.IdClass;
     12import javax.persistence.Table;
    1313import java.io.Serial;
    1414import java.io.Serializable;
     
    2828    private static final long serialVersionUID = 1L;
    2929    @Id
    30     Long userid;
     30    Integer userid;
    3131    @Id
    3232    LocalDateTime orderdate;
  • src/main/java/com/example/autopartz/model/views/ReviewsForUser.java

    r6832924 rae042f4  
    11package com.example.autopartz.model.views;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.Table;
    63import lombok.Getter;
    74import lombok.RequiredArgsConstructor;
     
    107import org.hibernate.annotations.Immutable;
    118
     9import javax.persistence.Entity;
     10import javax.persistence.Id;
     11import javax.persistence.Table;
    1212import java.io.Serial;
    1313import java.io.Serializable;
     
    2525    private static final long serialVersionUID = 1L;
    2626    @Id
    27     Long repairid;
    28     Long userid;
     27    Integer repairid;
     28    Integer userid;
    2929    Integer rating;
    3030    String rcomment;
Note: See TracChangeset for help on using the changeset viewer.