-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1b91c4
commit fbf89ee
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/io/github/onecx/permission/domain/daos/PermissionAssignmentDAO.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,9 @@ | ||
package io.github.onecx.permission.domain.daos; | ||
|
||
import io.github.onecx.permission.domain.models.PermissionAssignment; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import org.tkit.quarkus.jpa.daos.AbstractDAO; | ||
|
||
@ApplicationScoped | ||
public class PermissionAssignmentDAO extends AbstractDAO<PermissionAssignment> { | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/io/github/onecx/permission/domain/daos/RoleDAO.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,10 @@ | ||
package io.github.onecx.permission.domain.daos; | ||
|
||
import io.github.onecx.permission.domain.models.Role; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import org.tkit.quarkus.jpa.daos.AbstractDAO; | ||
|
||
@ApplicationScoped | ||
public class RoleDAO extends AbstractDAO<Role> { | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/io/github/onecx/permission/domain/models/PermissionAssignment.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,24 @@ | ||
package io.github.onecx.permission.domain.models; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.TenantId; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
@Table(name = "PERMISSION_ASSIGNMENT") | ||
public class PermissionAssignment { | ||
|
||
@TenantId | ||
@Column(name = "TENANT_ID") | ||
private String tenantId; | ||
|
||
@Column(name = "ROLE_NAME") | ||
private String roleName; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY, optional = false) | ||
@JoinColumn(name = "PERMISSION_ID") | ||
private Permission permission; | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/io/github/onecx/permission/domain/models/Role.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,45 @@ | ||
package io.github.onecx.permission.domain.models; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Table; | ||
import jakarta.persistence.UniqueConstraint; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.TenantId; | ||
import org.tkit.quarkus.jpa.models.TraceableEntity; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
@Table(name = "ROLE", | ||
uniqueConstraints = { | ||
@UniqueConstraint(columnNames = {"TENANT_ID", "NAME"}) | ||
} | ||
) | ||
@SuppressWarnings("java:S2160") | ||
public class Role extends TraceableEntity { | ||
|
||
@TenantId | ||
@Column(name = "TENANT_ID") | ||
private String tenantId; | ||
|
||
/** | ||
* The role name. | ||
*/ | ||
@Column(name = "NAME") | ||
private String name; | ||
|
||
/** | ||
* The role description. | ||
*/ | ||
@Column(name = "DESCRIPTION") | ||
private String description; | ||
|
||
/** | ||
* The role short description. | ||
*/ | ||
@Column(name = "SHORT_DESCRIPTION") | ||
private String shortDescription; | ||
|
||
} |
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