diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java index b8ae11e4..5317b882 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java @@ -5,6 +5,7 @@ import java.util.function.Consumer; import lombok.EqualsAndHashCode; import lombok.Getter; import net.hostsharing.hsadminng.hs.office.relationship.HsOfficeRelationshipEntity; +import net.hostsharing.hsadminng.persistence.HasUuid; import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject; import jakarta.validation.constraints.NotNull; @@ -102,7 +103,7 @@ public class RbacView { } public RbacView importRootEntityAliasProxy( - final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { if ( rootEntityAliasProxy != null ) { throw new IllegalStateException("there is already an entityAliasProxy: " + rootEntityAliasProxy); } @@ -111,18 +112,18 @@ public class RbacView { } public RbacView importEntityAlias( - final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { importEntityAliasImpl(aliasName, entityClass, fetchSql, dependsOnColum); return this; } - private EntityAlias importEntityAliasImpl(final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + private EntityAlias importEntityAliasImpl(final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { final var entityAlias = new EntityAlias(aliasName, entityClass, fetchSql, dependsOnColum); entityAliases.put(aliasName, entityAlias); try { importAsAlias(aliasName, rbacDefinition(entityClass)); - } catch ( final Exception exc) { - new RuntimeException("cannot import entity: " + entityClass, exc); + } catch ( final ReflectiveOperationException exc) { + throw new RuntimeException("cannot import entity: " + entityClass, exc); } return entityAlias; }