main
Last change
on this file since 2e46f06 was 2e46f06, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 19 months ago |
Adding the models and testing one view
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2e46f06] | 1 | package com.example.autopartz.model;
|
---|
| 2 |
|
---|
| 3 | import jakarta.persistence.Entity;
|
---|
| 4 | import jakarta.persistence.Id;
|
---|
| 5 | import jakarta.persistence.Table;
|
---|
| 6 | import lombok.*;
|
---|
| 7 | import org.hibernate.Hibernate;
|
---|
| 8 | import org.hibernate.annotations.Immutable;
|
---|
| 9 | import org.hibernate.annotations.Subselect;
|
---|
| 10 |
|
---|
| 11 | import java.io.Serial;
|
---|
| 12 | import java.io.Serializable;
|
---|
| 13 | import java.util.Objects;
|
---|
| 14 |
|
---|
| 15 | // извештај за сите сервиси и за сите број на reviews и avg рејтинг
|
---|
| 16 | @Entity
|
---|
| 17 | @Getter
|
---|
| 18 | @Setter
|
---|
| 19 | @ToString
|
---|
| 20 | @RequiredArgsConstructor
|
---|
| 21 | @Immutable
|
---|
| 22 | @Table(name = "repair_shop_reviews_summary")
|
---|
| 23 | @Subselect("select * from repair_shop_reviews_summary")
|
---|
| 24 | public class RepairShopReviewsSummary implements Serializable {
|
---|
| 25 | @Serial
|
---|
| 26 | private static final long serialVersionUID = 1L;
|
---|
| 27 | @Id
|
---|
| 28 | Long rsid;
|
---|
| 29 | String rsname;
|
---|
| 30 | Integer reviewcount;
|
---|
| 31 | Float reviewaverage;
|
---|
| 32 |
|
---|
| 33 | @Override
|
---|
| 34 | public boolean equals(Object o) {
|
---|
| 35 | if (this == o) return true;
|
---|
| 36 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 37 | RepairShopReviewsSummary that = (RepairShopReviewsSummary) o;
|
---|
| 38 | return rsid != null && Objects.equals(rsid, that.rsid);
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | @Override
|
---|
| 42 | public int hashCode() {
|
---|
| 43 | return getClass().hashCode();
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.