-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* security module improvements * improve names of food products categories --------- Co-authored-by: Myller Sakaguchi Lobo <myller.lobo@omni.com.br>
- Loading branch information
1 parent
3efbfa9
commit da11458
Showing
39 changed files
with
506 additions
and
610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
src/main/java/com/fiap/tc/adapter/repository/entity/core/Group.java
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/main/java/com/fiap/tc/adapter/repository/entity/core/Module.java
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
src/main/java/com/fiap/tc/adapter/repository/entity/core/Profile.java
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/main/java/com/fiap/tc/adapter/repository/entity/core/Role.java
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
src/main/java/com/fiap/tc/adapter/repository/entity/core/Session.java
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/main/java/com/fiap/tc/adapter/repository/entity/core/System.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/com/fiap/tc/adapter/repository/entity/core/UserHistory.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
src/main/java/com/fiap/tc/adapter/repository/entity/security/FeatureEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.fiap.tc.adapter.repository.entity.security; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.*; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "feature", schema = "security") | ||
@Data | ||
public class FeatureEntity { | ||
|
||
@Id | ||
private String id; | ||
|
||
@Column(name = "name") | ||
private String name; | ||
|
||
@Column(name = "description") | ||
private String description; | ||
|
||
@Column(name = "active", columnDefinition = "boolean default true") | ||
private boolean active; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "id_system_module") | ||
private ModuleEntity module; | ||
|
||
@OneToMany(mappedBy = "feature") | ||
private List<RoleEntity> roles; | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/fiap/tc/adapter/repository/entity/security/ModuleEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.fiap.tc.adapter.repository.entity.security; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Table(name = "system_module", schema = "security") | ||
@Data | ||
public class ModuleEntity { | ||
|
||
@Id | ||
private String id; | ||
|
||
@Column(name = "name") | ||
private String name; | ||
|
||
@Column(name = "description") | ||
private String description; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "id_system") | ||
private SystemEntity system; | ||
|
||
@Column(name = "active", columnDefinition = "boolean default true") | ||
private boolean active; | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/fiap/tc/adapter/repository/entity/security/ProfileEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.fiap.tc.adapter.repository.entity.security; | ||
|
||
import com.fiap.tc.core.domain.enums.ProfileSystem; | ||
import lombok.Data; | ||
|
||
import javax.persistence.*; | ||
import java.io.Serializable; | ||
import java.util.Set; | ||
|
||
import static java.lang.String.format; | ||
|
||
@Entity | ||
@Data | ||
@Table(name = "profile", schema = "security") | ||
public class ProfileEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@Enumerated(EnumType.STRING) | ||
private ProfileSystem id; | ||
|
||
@Column(name = "name") | ||
private String name; | ||
|
||
@Column(name = "description") | ||
private String description; | ||
|
||
@Column(name = "active", columnDefinition = "boolean default true") | ||
private boolean active; | ||
|
||
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) | ||
@JoinTable(name = "roles_profile", schema = "security", | ||
joinColumns = {@JoinColumn(name = "id_profile")}, | ||
inverseJoinColumns = {@JoinColumn(name = "id_role")} | ||
) | ||
private Set<RoleEntity> roles; | ||
|
||
@Override | ||
public String toString() { | ||
return format("Profile{id:%s, nome:%s}", id, name); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/fiap/tc/adapter/repository/entity/security/RoleEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.fiap.tc.adapter.repository.entity.security; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Table(name = "role", schema = "security") | ||
@Data | ||
public class RoleEntity { | ||
|
||
@Id | ||
private String id; | ||
|
||
@Column(name = "name") | ||
private String name; | ||
|
||
@Column(name = "description") | ||
private String description; | ||
|
||
@Column(name = "active", columnDefinition = "boolean default true") | ||
private boolean active; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "id_feature") | ||
private FeatureEntity feature; | ||
|
||
} |
Oops, something went wrong.