Package com.github.hakko.musiccabinet.domain.model.music

Examples of com.github.hakko.musiccabinet.domain.model.music.ArtistRelation


  public void createTestData() throws ApplicationException {
    PostgreSQLUtil.truncateTables(artistRecommendationDao);

    List<ArtistRelation> artistRelations = new ArrayList<>();
    for (Artist targetArtist : asList(madonna, cyndi, celine, kylie)) {
      artistRelations.add(new ArtistRelation(targetArtist, 0.33f));
    }
    artistRelationDao.createArtistRelations(cher, artistRelations);

    tagDao.createTags(asList("disco"));
    tagDao.createTopArtists(Arrays.asList(new TagTopArtists("disco",
View Full Code Here


    verifyArtistRelation(parser, 99, "Lara Fabian", 0.0617754f);
  }
 
  private void verifyArtistRelation(ArtistSimilarityParser parser,
      int artistRelationIndex, String artistName, float match) {
    ArtistRelation relation = parser.getArtistRelations().get(artistRelationIndex);
    assertTrue(relation.getTarget().getName().equals(artistName));
    assertEquals(relation.getMatch(), match);
  }
View Full Code Here

  public void startElement(String uri, String localName, String qName, Attributes attributes)
  throws SAXException {
    if (TAG_SIMILAR_ARTISTS.equals(qName)) {
      artistName = attributes.getValue(TAG_ARTIST);
    } else if (TAG_ARTIST.equals(qName)) {
      currentArtistRelation = new ArtistRelation();
    } else {
      state = xmlToStateMap.get(qName);
      if (state != null) {
        characterData = new StringBuilder();
      }
View Full Code Here

      @Override
      public ArtistRelation mapRow(ResultSet rs, int rowNum)
          throws SQLException {
        String artistName = rs.getString(1);
        float match = rs.getFloat(2);
        return new ArtistRelation(new Artist(artistName), match);
      }
    });

    return artistRelations;
  }
View Full Code Here

    return jdbcTemplate.query(topArtistsSql, new Object[]{topTags.size()},
        new RowMapper<ArtistRelation>() {
      @Override
      public ArtistRelation mapRow(ResultSet rs, int rowNum) throws SQLException {
        return new ArtistRelation(new Artist(rs.getString(1)), rs.getFloat(2));
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.music.ArtistRelation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.