Ignore:
Timestamp:
01/06/23 02:51:45 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
d4b888e
Parents:
1bd8d1e
Message:

Added full functionality for creating order

File:
1 edited

Legend:

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

    r1bd8d1e rf484b14  
    1919public class ServiceBook {
    2020    @Id
    21     Integer ID_service_book;
     21    @Column(name = "ID_service_book")
     22    @GeneratedValue(strategy = GenerationType.IDENTITY)
     23    Integer id;
    2224    LocalDateTime sb_created_on;
    2325    @OneToOne
    2426    @JoinColumn(name = "vin")
    2527    CarSample carSample;
     28
     29    public ServiceBook(CarSample carSample) {
     30        this.sb_created_on = LocalDateTime.now();
     31        this.carSample = carSample;
     32    }
    2633
    2734    @Override
     
    3037        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
    3138        ServiceBook that = (ServiceBook) o;
    32         return ID_service_book != null && Objects.equals(ID_service_book, that.ID_service_book);
     39        return id != null && Objects.equals(id, that.id);
    3340    }
    3441
Note: See TracChangeset for help on using the changeset viewer.