-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemCarrinho.java
64 lines (52 loc) · 1.4 KB
/
ItemCarrinho.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.demo.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
/**
*
* @author Jefferson
*/
@Entity
public class ItemCarrinho {
private Long id;
private Produto produto;
private double quantidade;
private Carrinho carrinho;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@ManyToOne()
public Produto getProduto() {
return produto;
}
public void setProduto(Produto produto) {
this.produto = produto;
}
public double getQuantidade() {
return quantidade;
}
public void setQuantidade(double quantidade) {
this.quantidade = quantidade;
}
@JsonIgnore
@ManyToOne(/*cascade = CascadeType.MERGE*/)
public Carrinho getCarrinho() {
return carrinho;
}
public void setCarrinho(Carrinho carrinho) {
this.carrinho = carrinho;
}
}