public Collection<Artist> getAllArtists() throws DatabaseException {
Query query = new Query(Type.SELECT, "ARTISTS");
query.addField(new Field("ARTISTS.*"));
- query.addField(new Field("GROUP_ARTISTS.*"));
- query.addField(new Field("GROUPS.*"));
- query.addJoin(new Join(JoinType.INNER, "GROUP_ARTISTS", new Field("ARTISTS.ID"), new Field("GROUP_ARTISTS.ARTIST")));
- query.addJoin(new Join(JoinType.INNER, "GROUPS", new Field("GROUP_ARTISTS.GROUP_"), new Field("GROUPS.ID")));
- query.addOrderField(new OrderField(new Field("ARTISTS.ID")));
- ArtistLoader artistLoader = new ArtistLoader();
- database.process(query, artistLoader);
- return artistLoader.all();
+ return database.getMultiple(query, artistCreator);
}
public Artist getArtistById(String id) throws DatabaseException {