class MusicTypeStore {

    public int add(MusicType type) {
        int typeId = 0;
        if (!this.findAll().contains(type)) {
            try (Connection connect = CON.getConnect();
                 PreparedStatement st = connect.prepareStatement(QUERIES.getProperty("addMusicType"))) {
                st.setString(1, type.getType());
                try (ResultSet rstSet = st.executeQuery()) {
                    if (rstSet.next()) {
                        typeId = rstSet.getInt("id");
                    }
                }
            } catch (SQLException e) {
                LOG.error(e.getMessage(), e);
            }
        }
        return typeId;
    }

}