Package us.jyg.freshet.dao.model

Examples of us.jyg.freshet.dao.model.Album


    songQ.up(song, "");
        songManager.modifySongWeight(song, 1);
    }
 
  public void queueAlbum(FreshetForm ff) {
    Album album = albumManager.getAlbum(new Integer(ff.getQueueId()));
    List songs = songManager.getSongs(album);
        for (Iterator i=songs.iterator(); i.hasNext();)
            songManager.modifySongWeight(((Song)i.next()), 1);
        songQ.up(songs, "");
    }
View Full Code Here


  static int testSongCount = 0;

  public void testGetAlbums() {
    List albums = albumDao.getAlbums();
    for(Iterator itr=albums.iterator(); itr.hasNext();) {
      Album a = (Album)itr.next();
      log.debug("Album " + a.getId() + " " + a.getName());
    }
  }
View Full Code Here

  }
 
  public void testGetAlbumsByArtist() {
    List albums = albumDao.getAlbumsByArtist(1);
    for(Iterator itr=albums.iterator(); itr.hasNext();) {
      Album a = (Album)itr.next();
      log.debug("Album " + a.getId() + " " + a.getName());
    }
    albums.get(albums.size()-1);
  }
View Full Code Here

        else
            return true;
    }

    public Song saveSong(SongData songData) {
      Album album = albumDao.getAlbum(songData.getAlbum());
      Artist artist = artistDao.getArtist(songData.getArtist());
      Genre genre = genreDao.getGenre(songData.getGenre());
      Song song = new Song(songData.getName(), songData.getPath(), songData
          .getTrack(), album, artist, genre);
      saveSong(song);
View Full Code Here

    File f;
    while( (f=miner.next()) != null) {
      try {
        if (f.getName().matches(".*[mM][pP]3")) {
          SongData songData = new SongData(f);
          Album album = albumDao.getAlbum(songData.getAlbum());
          Artist artist = artistDao.getArtist(songData.getArtist());
          Genre genre = genreDao.getGenre(songData.getGenre());
          Song song = new Song(songData.getName(), songData.getPath(), songData
              .getTrack(), album, artist, genre);
          songDao.saveSong(song);
View Full Code Here

  public void testGetSong() {
    for(Iterator itr=songs.iterator(); itr.hasNext();) {
      Integer id = ((Song)itr.next()).getId();
      Song song = songDao.getSong(id);
      assertNotNull(song);
      Album album = song.getAlbum();
      assertNotNull(album);
      String albumName = album.getName();
      assertNotNull(albumName);
      assertFalse(albumName.equals(""));
    }
  }
View Full Code Here

    }
  }

  public void testGetSongs(SongAttribute attr) {
    Song song = (Song)songDao.getSongs().get(0);
    Album album = song.getAlbum();
    assertNotNull(album);
    assertNotNull(album.getId());
    assertTrue(album.getId() > 0);
    assertNotNull(album.getName());
//    List<Song> songs = songDao.getSongs(album);
    Set<Song> songs = album.getSongs();
    assertNotNull(songs);
    assertTrue(songs.size() > 0);
    log.debug("Album "+ album.getName() +" has "+ songs.size() + " songs.");
  }
View Full Code Here

  public List<Album> findAlbums(String pattern) {
    return null;
  }
 
  public Album renameAlbum(Integer albumId, String newName) {
    Album a = albumDao.getAlbum(albumId);
    a.setName(newName);
    albumDao.saveObject(a);
    return albumDao.getAlbum(albumId);
  }
View Full Code Here

    return (Album)getObject(Album.class, id);
  }
 
  public Album getAlbum(String name) {
    name = name.replaceAll("'", "%27");
    Album album;
    List albums = getHibernateTemplate().find("from Album a where a.name = '"+name+"'");
    if (albums.size() == 0)
      album = new Album(name);
    else
      album = (Album)albums.get(0);
    return album; 
  }
View Full Code Here

TOP

Related Classes of us.jyg.freshet.dao.model.Album

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.