query.addValueField(new ValueField("NAME", new StringParameter(artist.getName())));
query.addWhereClause(new ValueFieldWhereClause(new ValueField("ID", new StringParameter(artist.getId()))));
database.update(query);
+
+ /* save groups. */
+ Collection<Group> groups = artist.getGroups();
+ query = new Query(Type.DELETE, "GROUP_ARTISTS");
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("GROUP_ARTISTS.ARTIST", new StringParameter(artist.getId()))));
+ database.update(query);
+ for (Group group : groups) {
+ query = new Query(Type.INSERT, "GROUP_ARTISTS");
+ query.addValueField(new ValueField("GROUP_", new StringParameter(group.getId())));
+ query.addValueField(new ValueField("ARTIST", new StringParameter(artist.getId())));
+ database.insert(query);
+ }
+
+ /* save properties. */
saveArtistProperties(artist);
}