use of org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_NAME_BY_ID in project carbon-identity-framework by wso2.
the class ConfigurationDAOImpl method isExistingResource.
@Override
public boolean isExistingResource(int tenantId, String resourceId) throws ConfigurationManagementException {
JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();
String resourceName;
try {
resourceName = jdbcTemplate.fetchSingleRecord(GET_RESOURCE_NAME_BY_ID, (resultSet, rowNumber) -> resultSet.getString(DB_SCHEMA_COLUMN_NAME_NAME), preparedStatement -> {
preparedStatement.setString(1, resourceId);
preparedStatement.setInt(2, tenantId);
});
return StringUtils.isNotEmpty(resourceName);
} catch (DataAccessException e) {
throw handleServerException(ERROR_CODE_GET_RESOURCE, "id = " + resourceId, e);
}
}
Aggregations