| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import javax.persistence.*;
|
3 |
import javax.persistence.*;
|
| 4 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 5 |
import java.util.Objects;
|
5 |
import java.util.Objects;
|
| 6 |
|
6 |
|
| - |
|
7 |
|
| - |
|
8 |
@NamedQueries({
|
| - |
|
9 |
@NamedQuery(name = "Catalog.findOtherORNullCategoryAndInStock", query = "select i.catalogItemId "
|
| - |
|
10 |
+ " from WarehouseInventoryItem wi "
|
| - |
|
11 |
+ " join Item i on i.id = wi.itemId"
|
| - |
|
12 |
+ " left join CategorisedCatalog cc on cc.catalogId = i.catalogItemId and cc.endDate is null "
|
| - |
|
13 |
+ " where wi.currentQuantity > 0 and (cc.status is null OR cc.status = 'OTHER') and i.categoryId in (10006,10009,10010) and i.brand= :brand group by i.catalogItemId"),
|
| - |
|
14 |
|
| - |
|
15 |
@NamedQuery(name = "Catalog.findOtherORNullCategoryAndPartnerInStock", query = "select i.catalogItemId "
|
| - |
|
16 |
+ " from CurrentInventorySnapshot cis "
|
| - |
|
17 |
+ " join Item i on i.id = cis.itemId"
|
| - |
|
18 |
+ " left join CategorisedCatalog cc on cc.catalogId = i.catalogItemId and cc.endDate is null "
|
| - |
|
19 |
+ " where cis.availability > 0 and (cc.status is null OR cc.status = 'OTHER') and i.categoryId in (10006,10009,10010) and i.brand= :brand and cis.fofoId = :fofoId group by i.catalogItemId"),
|
| - |
|
20 |
})
|
| - |
|
21 |
|
| 7 |
@Entity
|
22 |
@Entity
|
| 8 |
@Table(name = "catalog.catalog")
|
23 |
@Table(name = "catalog.catalog")
|
| 9 |
public class Catalog {
|
24 |
public class Catalog {
|
| 10 |
@Id
|
25 |
@Id
|
| 11 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
26 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|