X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdb%2Fep%2FEpAppFunction.java;h=533309dff1f7ce488f103e7d39ceb8dcc5a3ad1b;hb=refs%2Fchanges%2F01%2F98501%2F2;hp=d37c71eccc1692887f6056849123e2a2b934a8de;hpb=672b45b653ef0e88b13c337e598307ad66931390;p=portal.git diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java index d37c71ec..533309df 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java @@ -51,6 +51,8 @@ import javax.persistence.IdClass; import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.validation.Valid; @@ -64,6 +66,7 @@ import lombok.Setter; import org.hibernate.validator.constraints.SafeHtml; import org.onap.portal.domain.db.ep.EpAppFunction.EpAppFunctionId; import org.onap.portal.domain.db.fn.FnApp; +import org.onap.portal.domain.dto.DomainVo; /* CREATE TABLE `ep_app_function` ( @@ -76,6 +79,20 @@ CREATE TABLE `ep_app_function` ( ) */ +@NamedQueries({ + @NamedQuery( + name = "EpAppFunction.getAppRoleFunctionList", + query = "from\n" + + " EpAppRoleFunction rf,\n" + + " EpAppFunction f\n" + + " where\n" + + " rf.fnRole.roleId = :roleId\n" + + " and rf.appId.appId = :appId\n" + + " and rf.appId.appId = f.appId.appId\n" + + " and rf.epAppFunction.functionCd = f.functionCd" + ) +}) + @Table(name = "ep_app_function", indexes = {@Index(name = "fk_ep_app_function_app_id", columnList = "app_id")}) @Getter @@ -84,7 +101,7 @@ CREATE TABLE `ep_app_function` ( @IdClass(EpAppFunctionId.class) @NoArgsConstructor @AllArgsConstructor -public class EpAppFunction implements Serializable{ +public class EpAppFunction extends DomainVo implements Serializable{ @Id @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "app_id") @@ -101,6 +118,14 @@ public class EpAppFunction implements Serializable{ @NotNull @SafeHtml private String functionName; + + private Long roleId; + private String type; + @SafeHtml + private String action; + @SafeHtml + private String editUrl; + @OneToMany( targetEntity = EpAppRoleFunction.class, mappedBy = "epAppFunction", @@ -109,6 +134,17 @@ public class EpAppFunction implements Serializable{ ) private Set epAppRoleFunctions; + public EpAppFunction(Long id, String code, String name, FnApp appId, String type, String action,String editUrl) { + super(); + this.id = id; + this.functionCd = code; + this.functionName = name; + this.appId = appId; + this.type = type; + this.action = action; + this.editUrl = editUrl; + } + @Getter @Setter @EqualsAndHashCode