app/repository/ArtistRepository.java
private void saveAdminArtistGenres(Artist newArtist, Form<Artist> artistProfileForm) {
        Optional<String> optionalGenres = artistProfileForm.field("genreForm").value();
        if (optionalGenres.isPresent() && !optionalGenres.get().isEmpty()) {
            for (String genre : optionalGenres.get().split(",")) {
                genreRepository.insertArtistGenre(newArtist.getArtistId(), parseInt(genre));
            }
        }
    }
/**
     * Method used to extract selected genres from a form binding and insert it into the artist_genre linking table
     * for the related artist.
     * @param newArtist an artist object
     * @param artistProfileForm the form containing all newly input the attributes of an artist
     */
Method used to extract selected genres from a form binding and insert it into the artist_genre linking table
for the related artist.
@param newArtist an artist object
@param artistProfileForm the form containing all newly input the attributes of an artist
Method used to extract selected genres from a form binding and insert it into the artist_genre linking table for the related artist . @param newArtist an artist object @param artistProfileForm the form containing all newly input the attributes of an artist
private void saveAdminArtistGenres(Artist newArtist, Form<Artist> artistProfileForm) {
        Optional<String> optionalGenres = artistProfileForm.field("genreForm").value();
        if (optionalGenres.isPresent() && !optionalGenres.get().isEmpty()) {
            for (String genre : optionalGenres.get().split(",")) {
                genreRepository.insertArtistGenre(newArtist.getArtistId(), parseInt(genre));
            }
        }
    }
private void saveAdminArtistGenres ( Artist newArtist , Form < Artist > artistProfileForm ) { Optional < String > optionalGenres = artistProfileForm . field ( "genreForm" ) . value ( ) ; if ( optionalGenres . isPresent ( ) && ! optionalGenres . get ( ) . isEmpty ( ) ) { for ( String genre : optionalGenres . get ( ) . split ( "," ) ) { genreRepository . insertArtistGenre ( newArtist . getArtistId ( ) , parseInt ( genre ) ) ; } } }
Method used to extract selected genres from a form binding and insert it into the artist_genre linking table
 for the related artist.
Method used to extract selected genres from a form binding and insert it into the artist_genre linking table for the related artist .