Ignore:
Timestamp:
01/03/23 19:29:20 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
60de3eb
Parents:
eaf0f1b
Message:

Added some views and functionalities

Location:
src/main/java/com/example/autopartz/model
Files:
4 edited
6 moved

Legend:

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

    reaf0f1b rfeffc2f  
    1818public class Part {
    1919    @Id
    20     Long ID_part;
    21     String part_name;
    22     String part_description;
     20    @Column(name = "ID_part")
     21    Long id;
     22    @Column(name = "part_name")
     23    String name;
     24    @Column(name = "part_description")
     25    String description;
    2326    @ManyToOne
    2427    @JoinColumn(name = "id_part_manufacturer")
    25     PartManufacturer partManufacturer;
     28    PartManufacturer manufacturer;
    2629    @ManyToMany
    2730    @JoinTable(name = "part_is_from_category", joinColumns =
     
    4851        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
    4952        Part part = (Part) o;
    50         return ID_part != null && Objects.equals(ID_part, part.ID_part);
     53        return id != null && Objects.equals(id, part.id);
    5154    }
    5255
  • src/main/java/com/example/autopartz/model/PartManufacturer.java

    reaf0f1b rfeffc2f  
    11package com.example.autopartz.model;
    22
     3import jakarta.persistence.Column;
    34import jakarta.persistence.Entity;
    45import jakarta.persistence.Id;
     
    1819    @Id
    1920    Long ID_part_manufacturer;
    20     String pm_name;
     21    @Column(name = "pm_name")
     22    String name;
    2123    String pm_location;
    2224
  • src/main/java/com/example/autopartz/model/RepairShop.java

    reaf0f1b rfeffc2f  
    1616public class RepairShop {
    1717    @Id
    18     Long ID_repair_shop;
    19     String rs_name;
    20     String rs_location;
    21     String rs_phone_number;
     18    @Column(name = "ID_repair_shop")
     19    Long id;
     20    @Column(name = "rs_name")
     21    String name;
     22    @Column(name = "rs_location")
     23    String location;
     24    @Column(name = "rs_phone_number")
     25    String number;
    2226    @ManyToMany
    2327    @JoinTable(name = "repair_shop_is_authorized_for_car_make", joinColumns =
     
    3236        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
    3337        RepairShop that = (RepairShop) o;
    34         return ID_repair_shop != null && Objects.equals(ID_repair_shop, that.ID_repair_shop);
     38        return id != null && Objects.equals(id, that.id);
    3539    }
    3640
  • src/main/java/com/example/autopartz/model/User.java

    reaf0f1b rfeffc2f  
    2121    String email;
    2222    String name_user;
    23     String password_user;
     23    @Column(name = "password_user")
     24    String password;
    2425    LocalDateTime user_created_on;
    2526    String phone_number;
     
    2728    @JoinColumn(name = "id_administrator")
    2829    Administrator administrator;
     30
     31    public User(String username, String name, String email, String password, String number) {
     32        this.username = username;
     33        this.name_user = name;
     34        this.email = email;
     35        this.password = password;
     36        this.phone_number = number;
     37        this.user_created_on = LocalDateTime.now();
     38    }
    2939
    3040    @Override
  • src/main/java/com/example/autopartz/model/views/OrdersForUser.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import jakarta.persistence.Entity;
     
    66import jakarta.persistence.Table;
    77import lombok.*;
    8 import org.hibernate.Hibernate;
    98import org.hibernate.annotations.Immutable;
    10 import org.hibernate.annotations.Subselect;
    119
    1210import java.io.Serial;
    1311import java.io.Serializable;
    14 import java.time.LocalDate;
    1512import java.time.LocalDateTime;
    16 import java.util.Objects;
    1713
    1814// извештај за сите сервиси и за сите број на reviews и avg рејтинг
  • src/main/java/com/example/autopartz/model/views/OrdersForUserId.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import lombok.Data;
  • src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import jakarta.persistence.Entity;
  • src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import jakarta.persistence.Entity;
     
    77import org.hibernate.Hibernate;
    88import org.hibernate.annotations.Immutable;
    9 import org.hibernate.annotations.Subselect;
    109
    1110import java.io.Serial;
  • src/main/java/com/example/autopartz/model/views/RepairsForUser.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import jakarta.persistence.Entity;
     
    55import jakarta.persistence.IdClass;
    66import jakarta.persistence.Table;
    7 import lombok.*;
    8 import org.hibernate.Hibernate;
     7import lombok.Getter;
     8import lombok.RequiredArgsConstructor;
     9import lombok.Setter;
     10import lombok.ToString;
    911import org.hibernate.annotations.Immutable;
    10 import org.hibernate.annotations.Subselect;
    1112
    1213import java.io.Serial;
    1314import java.io.Serializable;
    14 import java.time.LocalDate;
    1515import java.time.LocalDateTime;
    16 import java.util.Objects;
    1716
    1817// извештај за сите сервиси и за сите број на reviews и avg рејтинг
  • src/main/java/com/example/autopartz/model/views/ReviewsForUser.java

    reaf0f1b rfeffc2f  
    1 package com.example.autopartz.model;
     1package com.example.autopartz.model.views;
    22
    33import jakarta.persistence.Entity;
    44import jakarta.persistence.Id;
    5 import jakarta.persistence.IdClass;
    65import jakarta.persistence.Table;
    7 import lombok.*;
    8 import org.hibernate.Hibernate;
     6import lombok.Getter;
     7import lombok.RequiredArgsConstructor;
     8import lombok.Setter;
     9import lombok.ToString;
    910import org.hibernate.annotations.Immutable;
    10 import org.hibernate.annotations.Subselect;
    1111
    1212import java.io.Serial;
    1313import java.io.Serializable;
    14 import java.time.LocalDate;
    15 import java.time.LocalDateTime;
    16 import java.util.Objects;
    1714
    1815// извештај за сите сервиси и за сите број на reviews и avg рејтинг
Note: See TracChangeset for help on using the changeset viewer.