@Override
    public List<Gruppi> getGruppiByServizi(Servizi servizi) {

        List<Gruppi> result = new ArrayList();
        ResultSet rs = null;
        ResultSet rs1 = null;

        try {

            gIdGruppi_Servizi.setInt(1, servizi.getKey());
            rs = gIdGruppi_Servizi.executeQuery();

            while (rs != null && rs.next()) {

                try {

                    gGruppi.setInt(1, rs.getInt("id_gruppo"));
                    rs1 = gGruppi.executeQuery();


                } catch (SQLException exception) {
                    Logger.getLogger(MeetingplanDataLayer.class.getName()).log(Level.SEVERE, null, exception);
                }

                while (rs1 != null && rs1.next()) {
                    result.add(new GruppiMysqlImpl(this, rs1));
                }

            }

        } catch (SQLException exception) {
            Logger.getLogger(MeetingplanDataLayer.class.getName()).log(Level.SEVERE, null, exception);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(MeetingplanDataLayerMysqlImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
        }


        return result;
    }