Issues (86)

main/java/com/osomapps/pt/admin/ptuser/PtUser.java (6 issues)

1
package com.osomapps.pt.admin.ptuser;
2
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
import java.util.ArrayList;
6
import java.util.List;
7
import javax.persistence.Entity;
8
import javax.persistence.FetchType;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.JoinColumn;
13
import javax.persistence.JoinTable;
14
import javax.persistence.ManyToMany;
15
import javax.persistence.SequenceGenerator;
16
import javax.persistence.Table;
17
import lombok.AllArgsConstructor;
18
import lombok.Getter;
19
import lombok.NoArgsConstructor;
20
import lombok.Setter;
21
import lombok.experimental.Accessors;
22
import org.hibernate.annotations.DynamicInsert;
23
24
@AllArgsConstructor
25
@NoArgsConstructor
26
@Accessors(chain = true)
27
@Getter
28
@Setter
29
@Entity
30
@Table(name = "pt_user", schema = "ptcore")
31
@DynamicInsert
32
public class PtUser implements Serializable {
33
    @Id
34
    @SequenceGenerator(
35
            name = "PtUserIdSequence",
36
            sequenceName = "ptcore.pt_user_id_seq",
37
            allocationSize = 1,
38
            initialValue = 1)
39
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PtUserIdSequence")
40
    Long id;
41
42
    LocalDateTime created;
0 ignored issues
show
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
43
    String login;
44
    String password;
45
    String name;
46
    LocalDateTime activated;
0 ignored issues
show
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
47
    Boolean is_blocked;
48
    Boolean is_blocked_date_set;
49
    String blocked_comment;
50
    LocalDateTime blocked_start;
0 ignored issues
show
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
51
    LocalDateTime blocked_finish;
0 ignored issues
show
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
52
    LocalDateTime deleted;
0 ignored issues
show
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
53
    String deleted_comment;
54
    Boolean is_deleted;
55
    Boolean is_default_password;
56
    String description;
57
    String phone;
58
    String phone2;
59
60
    @ManyToMany(fetch = FetchType.EAGER)
61
    @JoinTable(
62
            name = "pt_user_has_pt_role",
63
            schema = "ptcore",
64
            joinColumns = {@JoinColumn(name = "pt_user_id")},
65
            inverseJoinColumns = {@JoinColumn(name = "pt_role_id")})
66
    List<PtRole> ptRoles = new ArrayList<>(0);
0 ignored issues
show
Bug Best Practice introduced by
Make "ptRoles" private or transient.
Loading history...
67
}
68