Package us.jyg.freshet.dao.model

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


    }

    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);
      return song;
  }
View Full Code Here


      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);
//          log.debug("Saved: " + song.getName() + " ("+song.getId() +")"+
//              ", " + song.getAlbum().getName() +
View Full Code Here

  public List<Genre> findGenre(String pattern) {
    return genreDao.findGenre(pattern);
  }
 
  public Genre renameGenre(Integer genreId, String newName) {
    Genre g = genreDao.getGenre(genreId);
    g.setName(newName);
    genreDao.saveObject(g);
    return genreDao.getGenre(genreId);
  }
View Full Code Here

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

TOP

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

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.