Changeset ae042f4 for src/main/java/com/example/autopartz/model
- Timestamp:
- 01/04/23 02:49:26 (23 months ago)
- Branches:
- main
- Children:
- ab952ab
- Parents:
- 6832924
- 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 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.Setter; 5 import lombok.ToString; 5 6 import org.hibernate.Hibernate; 7 import org.springframework.security.core.GrantedAuthority; 6 8 9 import javax.persistence.Entity; 7 10 import java.time.LocalDate; 11 import java.util.Collection; 12 import java.util.Collections; 8 13 import java.util.Objects; 9 14 … … 29 34 return getClass().hashCode(); 30 35 } 36 37 @Override 38 public Collection<? extends GrantedAuthority> getAuthorities() { 39 return Collections.singletonList(Role.ROLE_ADMIN); 40 } 31 41 } -
src/main/java/com/example/autopartz/model/Car.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.util.Objects; 8 11 … … 15 18 public class Car { 16 19 @Id 17 LongID_car;20 Integer ID_car; 18 21 Integer in_production_since; 19 22 Integer in_production_till; -
src/main/java/com/example/autopartz/model/CarManufacturer.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.Id;5 import jakarta.persistence.Table;6 import lombok. *;3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 7 7 import org.hibernate.Hibernate; 8 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.Table; 9 12 import java.util.Objects; 10 13 … … 17 20 public class CarManufacturer { 18 21 @Id 19 LongID_car_manufacturer;22 Integer ID_car_manufacturer; 20 23 String cm_name; 21 24 String cm_country; -
src/main/java/com/example/autopartz/model/CarSample.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.util.Objects; 8 11 -
src/main/java/com/example/autopartz/model/Category.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.util.Objects; 8 11 … … 14 17 public class Category { 15 18 @Id 16 LongID_category;19 Integer ID_category; 17 20 @Column(name = "category_name") 18 21 String cname; -
src/main/java/com/example/autopartz/model/Client.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 8 import org.springframework.security.core.GrantedAuthority; 6 9 10 import javax.persistence.Entity; 11 import java.util.Collection; 12 import java.util.Collections; 7 13 import java.util.Objects; 8 14 … … 25 31 return getClass().hashCode(); 26 32 } 33 @Override 34 public Collection<? extends GrantedAuthority> getAuthorities() { 35 return Collections.singletonList(Role.ROLE_CLIENT); 36 } 27 37 } -
src/main/java/com/example/autopartz/model/Delivery.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.util.Objects; 8 11 … … 14 17 public class Delivery { 15 18 @Id 16 LongID_delivery;19 Integer ID_delivery; 17 20 String delivery_status; 18 21 String delivery_address; -
src/main/java/com/example/autopartz/model/Deliveryman.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Table; 5 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 6 7 import org.hibernate.Hibernate; 8 import org.springframework.security.core.GrantedAuthority; 7 9 10 import javax.persistence.Entity; 11 import javax.persistence.Table; 8 12 import java.time.LocalDate; 13 import java.util.Collection; 14 import java.util.Collections; 9 15 import java.util.Objects; 10 16 … … 30 36 return getClass().hashCode(); 31 37 } 38 @Override 39 public Collection<? extends GrantedAuthority> getAuthorities() { 40 return Collections.singletonList(Role.ROLE_DELIVERYMAN); 41 } 32 42 } -
src/main/java/com/example/autopartz/model/Order.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.time.LocalDateTime; 8 11 import java.util.List; … … 17 20 public class Order { 18 21 @Id 19 LongID_order;22 Integer ID_order; 20 23 String order_status; 21 24 LocalDateTime order_date; -
src/main/java/com/example/autopartz/model/Part.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*;4 3 import lombok.Getter; 5 4 import lombok.RequiredArgsConstructor; … … 8 7 import org.hibernate.Hibernate; 9 8 9 import javax.persistence.*; 10 10 import java.util.List; 11 11 import java.util.Objects; … … 19 19 @Id 20 20 @Column(name = "ID_part") 21 Longid;21 Integer id; 22 22 @Column(name = "part_name") 23 23 String name; -
src/main/java/com/example/autopartz/model/PartManufacturer.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 7 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 8 7 import org.hibernate.Hibernate; 9 8 9 import javax.persistence.Column; 10 import javax.persistence.Entity; 11 import javax.persistence.Id; 12 import javax.persistence.Table; 10 13 import java.util.Objects; 11 14 … … 18 21 public class PartManufacturer { 19 22 @Id 20 LongID_part_manufacturer;23 Integer ID_part_manufacturer; 21 24 @Column(name = "pm_name") 22 25 String name; -
src/main/java/com/example/autopartz/model/Price.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Id; 5 import jakarta.persistence.JoinColumn; 6 import jakarta.persistence.ManyToOne; 7 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 8 7 import org.hibernate.Hibernate; 9 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.JoinColumn; 12 import javax.persistence.ManyToOne; 10 13 import java.time.LocalDate; 11 14 import java.util.Objects; … … 18 21 public class Price { 19 22 @Id 20 LongID_price;23 Integer ID_price; 21 24 Integer amount; 22 25 LocalDate price_from; -
src/main/java/com/example/autopartz/model/Repair.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Id; 5 import jakarta.persistence.JoinColumn; 6 import jakarta.persistence.ManyToOne; 7 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 8 7 import org.hibernate.Hibernate; 9 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.JoinColumn; 12 import javax.persistence.ManyToOne; 10 13 import java.util.Objects; 11 14 … … 17 20 public class Repair { 18 21 @Id 19 LongID_repair;22 Integer ID_repair; 20 23 @ManyToOne 21 24 @JoinColumn(name = "vin") -
src/main/java/com/example/autopartz/model/RepairShop.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.util.List; 8 11 import java.util.Objects; … … 17 20 @Id 18 21 @Column(name = "ID_repair_shop") 19 Longid;22 Integer id; 20 23 @Column(name = "rs_name") 21 24 String name; -
src/main/java/com/example/autopartz/model/Review.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Id; 5 import jakarta.persistence.JoinColumn; 6 import jakarta.persistence.ManyToOne; 7 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 8 7 import org.hibernate.Hibernate; 9 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.JoinColumn; 12 import javax.persistence.ManyToOne; 10 13 import java.util.Objects; 11 14 … … 17 20 public class Review { 18 21 @Id 19 LongID_review;22 Integer ID_review; 20 23 Integer review_rating; 21 24 String review_comment; -
src/main/java/com/example/autopartz/model/ServiceBook.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 6 8 9 import javax.persistence.*; 7 10 import java.time.LocalDateTime; 8 11 import java.util.Objects; … … 16 19 public class ServiceBook { 17 20 @Id 18 LongID_service_book;21 Integer ID_service_book; 19 22 LocalDateTime sb_created_on; 20 23 @OneToOne -
src/main/java/com/example/autopartz/model/User.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 8 import org.springframework.security.core.GrantedAuthority; 9 import org.springframework.security.core.userdetails.UserDetails; 6 10 11 import javax.persistence.*; 7 12 import java.time.LocalDateTime; 13 import java.util.Collection; 14 import java.util.Collections; 8 15 import java.util.Objects; 9 16 … … 15 22 @Table(name = "users_table") 16 23 @Inheritance(strategy = InheritanceType.JOINED) 17 public class User {24 public class User implements UserDetails { 18 25 @Id 19 LongID_user;26 Integer ID_user; 20 27 String username; 21 28 String email; … … 50 57 return getClass().hashCode(); 51 58 } 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 } 52 85 } -
src/main/java/com/example/autopartz/model/Warehouse.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Id; 5 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 6 7 import org.hibernate.Hibernate; 7 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 8 11 import java.util.Objects; 9 12 … … 15 18 public class Warehouse { 16 19 @Id 17 LongID_warehouse;20 Integer ID_warehouse; 18 21 String warehouse_location; 19 22 -
src/main/java/com/example/autopartz/model/Warehouseman.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.JoinColumn;5 import jakarta.persistence.ManyToOne;6 import lombok. *;3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 7 7 import org.hibernate.Hibernate; 8 import org.springframework.security.core.GrantedAuthority; 8 9 10 import javax.persistence.Entity; 11 import javax.persistence.JoinColumn; 12 import javax.persistence.ManyToOne; 9 13 import java.time.LocalDate; 14 import java.util.Collection; 15 import java.util.Collections; 10 16 import java.util.Objects; 11 17 … … 33 39 return getClass().hashCode(); 34 40 } 41 @Override 42 public Collection<? extends GrantedAuthority> getAuthorities() { 43 return Collections.singletonList(Role.ROLE_WAREHOUSEMAN); 44 } 35 45 } -
src/main/java/com/example/autopartz/model/views/OrdersForUser.java
r6832924 rae042f4 1 1 package com.example.autopartz.model.views; 2 2 3 import jakarta.persistence.Entity; 4 import jakarta.persistence.Id; 5 import jakarta.persistence.IdClass; 6 import jakarta.persistence.Table; 7 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 8 7 import org.hibernate.annotations.Immutable; 9 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.IdClass; 12 import javax.persistence.Table; 10 13 import java.io.Serial; 11 14 import java.io.Serializable; … … 25 28 private static final long serialVersionUID = 1L; 26 29 @Id 27 Longuserid;30 Integer userid; 28 31 @Id 29 32 LocalDateTime orderdate; -
src/main/java/com/example/autopartz/model/views/OrdersForUserId.java
r6832924 rae042f4 8 8 @Data 9 9 public class OrdersForUserId implements Serializable { 10 Longuserid;10 Integer userid; 11 11 LocalDateTime orderdate; 12 12 String partname; -
src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java
r6832924 rae042f4 1 1 package com.example.autopartz.model.views; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.Id;5 import jakarta.persistence.Table;6 import lombok. *;3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 7 7 import org.hibernate.annotations.Immutable; 8 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.Table; 9 12 import java.io.Serial; 10 13 import java.io.Serializable; … … 21 24 private static final long serialVersionUID = 1L; 22 25 @Id 23 Longpartid;26 Integer partid; 24 27 String partname; 25 28 String cartype; -
src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java
r6832924 rae042f4 1 1 package com.example.autopartz.model.views; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.Id;5 import jakarta.persistence.Table;6 import lombok. *;3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 7 7 import org.hibernate.Hibernate; 8 8 import org.hibernate.annotations.Immutable; 9 9 10 import javax.persistence.Entity; 11 import javax.persistence.Id; 12 import javax.persistence.Table; 10 13 import java.io.Serial; 11 14 import java.io.Serializable; … … 24 27 private static final long serialVersionUID = 1L; 25 28 @Id 26 Longrsid;29 Integer rsid; 27 30 String rsname; 28 Integerreviewcount;31 Long reviewcount; 29 32 Float reviewaverage; 30 33 -
src/main/java/com/example/autopartz/model/views/RepairsForUser.java
r6832924 rae042f4 1 1 package com.example.autopartz.model.views; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.Id;5 import jakarta.persistence.IdClass;6 import jakarta.persistence.Table;7 3 import lombok.Getter; 8 4 import lombok.RequiredArgsConstructor; … … 11 7 import org.hibernate.annotations.Immutable; 12 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.IdClass; 12 import javax.persistence.Table; 13 13 import java.io.Serial; 14 14 import java.io.Serializable; … … 28 28 private static final long serialVersionUID = 1L; 29 29 @Id 30 Longuserid;30 Integer userid; 31 31 @Id 32 32 LocalDateTime orderdate; -
src/main/java/com/example/autopartz/model/views/ReviewsForUser.java
r6832924 rae042f4 1 1 package com.example.autopartz.model.views; 2 2 3 import jakarta.persistence.Entity;4 import jakarta.persistence.Id;5 import jakarta.persistence.Table;6 3 import lombok.Getter; 7 4 import lombok.RequiredArgsConstructor; … … 10 7 import org.hibernate.annotations.Immutable; 11 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.Table; 12 12 import java.io.Serial; 13 13 import java.io.Serializable; … … 25 25 private static final long serialVersionUID = 1L; 26 26 @Id 27 Longrepairid;28 Longuserid;27 Integer repairid; 28 Integer userid; 29 29 Integer rating; 30 30 String rcomment;
Note:
See TracChangeset
for help on using the changeset viewer.