Package co.cubicode.rbacframework.biz

Source Code of co.cubicode.rbacframework.biz.RolePermissionBiz

package co.cubicode.rbacframework.biz;

import java.util.List;

import co.cubicode.jdbcframework.DatabaseFactory;
import co.cubicode.jdbcframework.SQL;
import co.cubicode.jdbcframework.SQLQuery;
import co.cubicode.jdbcframework.exceptions.ObjectNotFoundException;
import co.cubicode.rbacframework.models.Role;
import co.cubicode.rbacframework.models.pack.RolePermission;

public class RolePermissionBiz {

  public static List<RolePermission> findByRoleAndApplication(Role role, String application) throws ObjectNotFoundException {
    DatabaseFactory instance = DatabaseFactory.getInstance("rbac");
    SQLQuery sql = SQL.getSQL(RolePermission.class, "findByRoleAndApplication");
    sql.setParameter("role", role.getId());
    sql.setParameter("application", application);
    return instance.queryForList(RolePermission.class, sql);
  }

}
TOP

Related Classes of co.cubicode.rbacframework.biz.RolePermissionBiz

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.