class RoleStore {

    public int add(Role role) {
        int result = 0;
        if (role != null && !findAll().contains(role)) {
            try (Connection connect = CON.getConnect();
                 PreparedStatement st = connect.prepareStatement(QUERIES.getProperty("addRole"))) {
                st.setString(1, role.getRole());
                try (ResultSet rstSet = st.executeQuery()) {
                    if (rstSet.next()) {
                        result = rstSet.getInt("id");
                    }
                }
            } catch (SQLException e) {
                LOG.error(e.getMessage(), e);
            }
        }
        return result;
    }

}