Changeset eaf0f1b


Ignore:
Timestamp:
01/03/23 03:19:50 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
feffc2f
Parents:
23a2bc5
Message:

Added all ManyToMany tables

Location:
src/main/java/com/example/autopartz/model
Files:
3 edited

Legend:

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

    r23a2bc5 reaf0f1b  
    66
    77import java.time.LocalDateTime;
     8import java.util.List;
    89import java.util.Objects;
    910
     
    2223    @ManyToOne
    2324    Client user;
     25    @ManyToMany
     26    @JoinTable(name = "order_contains_part", joinColumns =
     27    @JoinColumn(name = "id_order"),
     28            inverseJoinColumns = @JoinColumn(name = "id_part"))
     29    @ToString.Exclude
     30    List<Part> partList;
    2431
    2532    @Override
  • src/main/java/com/example/autopartz/model/Part.java

    r23a2bc5 reaf0f1b  
    22
    33import jakarta.persistence.*;
    4 import lombok.*;
     4import lombok.Getter;
     5import lombok.RequiredArgsConstructor;
     6import lombok.Setter;
     7import lombok.ToString;
    58import org.hibernate.Hibernate;
    69
    7 import java.util.ArrayList;
    810import java.util.List;
    911import java.util.Objects;
     
    2830    @ToString.Exclude
    2931    List<Category> categoryList;
     32    @ManyToMany
     33    @JoinTable(name = "part_is_in_stock_in_warehouse", joinColumns =
     34    @JoinColumn(name = "id_part"),
     35            inverseJoinColumns = @JoinColumn(name = "id_warehouse"))
     36    @ToString.Exclude
     37    List<Warehouse> warehouseList;
     38    @ManyToMany
     39    @JoinTable(name = "part_is_appropriate_for_car", joinColumns =
     40    @JoinColumn(name = "id_part"),
     41            inverseJoinColumns = @JoinColumn(name = "id_car"))
     42    @ToString.Exclude
     43    List<Car> carList;
    3044
    3145    @Override
  • src/main/java/com/example/autopartz/model/RepairShop.java

    r23a2bc5 reaf0f1b  
    11package com.example.autopartz.model;
    22
    3 import jakarta.persistence.Entity;
    4 import jakarta.persistence.Id;
    5 import jakarta.persistence.Table;
     3import jakarta.persistence.*;
    64import lombok.*;
    75import org.hibernate.Hibernate;
    86
     7import java.util.List;
    98import java.util.Objects;
    109
     
    2120    String rs_location;
    2221    String rs_phone_number;
     22    @ManyToMany
     23    @JoinTable(name = "repair_shop_is_authorized_for_car_make", joinColumns =
     24    @JoinColumn(name = "id_repair_shop"),
     25            inverseJoinColumns = @JoinColumn(name = "id_car_manufacturer"))
     26    @ToString.Exclude
     27    List<CarManufacturer> carManufacturerList;
    2328
    2429    @Override
Note: See TracChangeset for help on using the changeset viewer.