1+ package com .meevent .webapi .model ;
2+
3+ import jakarta .persistence .*;
4+
5+ import java .math .BigDecimal ;
6+ import java .time .OffsetDateTime ;
7+
8+ @ Entity
9+ @ Table (name = "products" )
10+ public class Product {
11+
12+ @ Id
13+ @ GeneratedValue (strategy = GenerationType .IDENTITY )
14+ private Integer id ;
15+
16+ @ Column (unique = true , nullable = false )
17+ private String sku ;
18+
19+ @ Column (nullable = false )
20+ private String name ;
21+
22+ private String category ;
23+
24+ private BigDecimal price ;
25+
26+ private Integer stock ;
27+
28+ @ Column (name = "is_active" )
29+ private Boolean isActive ;
30+
31+ @ Column (name = "tags" , columnDefinition = "text[]" )
32+ private String [] tags ; // Mapeo simple de array de Postgres
33+
34+ @ Column (name = "created_at" , insertable = false , updatable = false )
35+ private OffsetDateTime createdAt ;
36+
37+ public Integer getId () {
38+ return id ;
39+ }
40+
41+ public void setId (Integer id ) {
42+ this .id = id ;
43+ }
44+
45+ public String getSku () {
46+ return sku ;
47+ }
48+
49+ public void setSku (String sku ) {
50+ this .sku = sku ;
51+ }
52+
53+ public String getName () {
54+ return name ;
55+ }
56+
57+ public void setName (String name ) {
58+ this .name = name ;
59+ }
60+
61+ public String getCategory () {
62+ return category ;
63+ }
64+
65+ public void setCategory (String category ) {
66+ this .category = category ;
67+ }
68+
69+ public Integer getStock () {
70+ return stock ;
71+ }
72+
73+ public void setStock (Integer stock ) {
74+ this .stock = stock ;
75+ }
76+
77+ public BigDecimal getPrice () {
78+ return price ;
79+ }
80+
81+ public void setPrice (BigDecimal price ) {
82+ this .price = price ;
83+ }
84+
85+ public Boolean getActive () {
86+ return isActive ;
87+ }
88+
89+ public void setActive (Boolean active ) {
90+ isActive = active ;
91+ }
92+
93+ public String [] getTags () {
94+ return tags ;
95+ }
96+
97+ public void setTags (String [] tags ) {
98+ this .tags = tags ;
99+ }
100+
101+ public OffsetDateTime getCreatedAt () {
102+ return createdAt ;
103+ }
104+
105+ public void setCreatedAt (OffsetDateTime createdAt ) {
106+ this .createdAt = createdAt ;
107+ }
108+ }
0 commit comments