app/repository/ArtistRepository.java
private void saveAdminArtistAdmins(Artist newArtist, Form<Artist> artistProfileForm, Integer currentUserId) {
        Optional<String> optionalProfiles = artistProfileForm.field("adminForm").value();
        if (optionalProfiles.isPresent() && !optionalProfiles.get().isEmpty()) {
            //Insert ArtistProfiles for new Artist.
            for (String profileIdString : optionalProfiles.get().split(",")) {
                Integer profileId = parseInt(profileIdString);
                ArtistProfile artistProfile = new ArtistProfile(newArtist.getArtistId(), profileId);
                insertProfileLink(artistProfile);
            }
        } else {
            insertProfileLink(new ArtistProfile(newArtist.getArtistId(), currentUserId));
        }
    }
/**
     * Method used to extract selected artist profiles (as admins) from a form binding and insert it into the artist_profile 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 artist profiles (as admins) from a form binding and insert it into the artist_profile 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 artist profiles ( as admins ) from a form binding and insert it into the artist_profile 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 saveAdminArtistAdmins(Artist newArtist, Form<Artist> artistProfileForm, Integer currentUserId) {
        Optional<String> optionalProfiles = artistProfileForm.field("adminForm").value();
        if (optionalProfiles.isPresent() && !optionalProfiles.get().isEmpty()) {
            for (String profileIdString : optionalProfiles.get().split(",")) {
                Integer profileId = parseInt(profileIdString);
                ArtistProfile artistProfile = new ArtistProfile(newArtist.getArtistId(), profileId);
                insertProfileLink(artistProfile);
            }
        } else {
            insertProfileLink(new ArtistProfile(newArtist.getArtistId(), currentUserId));
        }
    }
private void saveAdminArtistAdmins ( Artist newArtist , Form < Artist > artistProfileForm , Integer currentUserId ) { Optional < String > optionalProfiles = artistProfileForm . field ( "adminForm" ) . value ( ) ; if ( optionalProfiles . isPresent ( ) && ! optionalProfiles . get ( ) . isEmpty ( ) ) { for ( String profileIdString : optionalProfiles . get ( ) . split ( "," ) ) { Integer profileId = parseInt ( profileIdString ) ; ArtistProfile artistProfile = new ArtistProfile ( newArtist . getArtistId ( ) , profileId ) ; insertProfileLink ( artistProfile ) ; } } else { insertProfileLink ( new ArtistProfile ( newArtist . getArtistId ( ) , currentUserId ) ) ; } }
Method used to extract selected artist profiles (as admins) from a form binding and insert it into the artist_profile linking table
 for the related artist.
Method used to extract selected artist profiles ( as admins ) from a form binding and insert it into the artist_profile linking table for the related artist .
//Insert ArtistProfiles for new Artist.