org.musicontroller.dao
Class HibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.musicontroller.dao.HibernateDao
All Implemented Interfaces:
Dao, UserDao, org.springframework.beans.factory.InitializingBean

public class HibernateDao
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements Dao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateDao()
           
 
Method Summary
 int count(java.lang.String hql, java.util.Map<java.lang.String,java.lang.Object> params)
           
 void delete(IUser user)
          Deletes a User-object.
 void deleteAiBag(AIBag delete)
          Deletes an AIBag.
 void deleteArtist(Artist delete)
          Deletes an artist.
 void evict(java.lang.Object o)
           
 void evictSong(long songId)
           
 java.util.List<IUser> findUserByLoginname(java.lang.String loginname)
          List Users by specifying a certain loginname
 IUser findUserByName(java.lang.String username)
          Searches for a User, and returns if, if found.
 IUser findUserByNamePassword(java.lang.String username, java.lang.String password)
          Get a Particpant by specifying its loginname ans encrypted password
 AIBag getAIBagById(long id)
          Retrieves the ai_bag with the given id from the database.
 AIBag getArtistAppearances(long artistid)
          Return a list of all appearances of an artist in songs.
 Artist getArtistById(long id)
          Retrieves the artist with the given id from the database.
 Authority getAuthorityById(int authorityId)
           
 Band getBandById(long id)
          Retrieves the band with the given id from the database.
 Band getBandByName(java.lang.String name)
          Retrieves the band with the given name from the database.
 java.util.List<java.lang.Long[]> getDoubleSongs()
          Searches the database for songs that are stored more than one time in the database.
protected  Playlist getForgottenSongs(IUser user)
          Lists a maximum amount of 25 Songs, with the following properties: The Songs have not been played, skipped, downloaded or requested at all during the last two years. The Songs have been played at least 10 times. The list is ordered to the plays/year ratio.
 Instrument getInstrumentById(long id)
          Retrieves the instrument with the given id from the database.
 Keywordbag getKeywordBagById(long id)
          Retrieves the keyword bag with the given id from the database.
 Keyword getKeywordById(long id)
          Retrieves the keyword with the given id from the database.
 Keywordbag getKeywordsBag(java.util.Collection<Keyword> keywords)
           
 AIBag getMostUsedAIBag(Band band)
          Searches the database for the most used AIBag for this band.
 Playlist getNeighbours(long songid, IUser user)
          Returns a Playlist containing Songs that are neighbours of the given Song and User.
 Playlist getPlaylistById(long id, IUser user)
          Returns a specific Playlist
 Playlist getPlaylistByName(java.lang.String name)
          Retrieves the Playlist with the given name from the database.
 Role getRoleById(int roleId)
           
 org.hibernate.SessionFactory getSessionFactory2()
          Returns the SessionFactory.
 Song getSong(Band band, java.lang.String songname)
          Find a song with the given name performed by the specified band.
 Song getSongById(long id)
          Retrieves the song with the given id from the database.
 java.util.List<java.lang.Long> getSongIds()
           
 java.util.List<Song> getSongsById(java.util.Collection<java.lang.Long> ids)
          Retrieves a number of songs from the database, corresponding with the given Ids.
 org.springframework.orm.hibernate3.HibernateTemplate getSupport()
           
 IUser getUserById(long userId)
          Get a User by specifying its id.
 IUser getUserByLoginname(java.lang.String inlognaam)
          Get a User by specifying its loginname
 java.util.List<AIBag> listAIBags()
          Returns a list of all Artist-Instrument bags.
 java.util.List<Authority> listAuthorities()
           
 java.util.List<java.lang.Object[]> listBands(IUser user)
           
 java.util.List<Keywordbag> listKeywordbags()
          Returns a list of all Keyword bags.
 java.util.List<Keyword> listKeywords()
          Lists all known Keywords.
 java.util.List<java.lang.Object[]> listKeywords(IUser user, java.util.List<Keywordbag> bags)
           
 java.util.List<Keywordbag> listKeywordsBags(java.util.List<Keyword> keywords)
          Returns a list with all keyword bags that contain at least all keywords given in the "keywords" parameter.
 java.util.List<java.lang.Object[]> listMonthlySongCounts()
           
 java.util.Map<java.lang.String,java.lang.Integer> listMonthlyStatistics(IUser user)
          Returns per-user play-statistics.
 java.util.List<java.lang.Object[]> listNamableItems()
           
 java.util.List<Playlist> listPlaylists()
          Lists all Playlists.
 java.util.List<Playlist> listPlaylists(Band band)
          Lists all playlists on which a band is present.
 java.util.List<Playlist> listPlaylists(Song song)
           
 java.util.List<Playlist> listPodcasts()
          Lists all Playlists that contain Podcasts.
 java.util.List<Role> listRoles()
           
 java.util.List<IUser> listUsers()
          List all Users.
 void mergeBands(Band keep, Band remove)
          Merge two bands, moving all songs from one to the other.
 void mergePlaylists(Playlist keep, Playlist delete)
          Merge the two playlists into one.
 void mergeSongs(Song keep, Song remove)
          Merges two songs to one.
 void registerSongChangeListener(SongChangeListener listener)
          Adds a SongChangeListener to the internal list of listeners.
 void save(AIBag aibag)
          Persist the properties of this AIBag.
 void save(Artist artist)
          Persist the properties of this artist.
 void save(Authority authority)
           
 void save(Band band)
          Persist the properties of this band.
 void save(Instrument instr)
          Persist the properties of this Instrument.
 void save(IUser user)
          Persists a User-object.
 void save(Keyword keyword)
          Persist the properties of this keyword.
 void save(Keywordbag keywordbag)
          Persist a keyword bag.
 void save(Link link)
          Persist the properties of this link.
 void save(Playlist playlist)
          Persist the properties of this playlist.
 void save(Role role)
           
 void save(Song song)
          Persist the properties of this song.
 java.util.List search(java.lang.String hql, java.util.Map<java.lang.String,java.lang.Object> params, int maxResults)
          Searches in the Database, and returns the objects that were selected.
 java.util.List search(java.lang.String hql, java.util.Map<java.lang.String,java.lang.Object> params, int maxResults, int offset)
          Searches in the Database, and returns the objects that were selected.
 Artist searchArtist(java.lang.String artistfirstname, java.lang.String artistlastname)
          Find an artist matching the given first and last name.
 Band searchBand(java.lang.String bandname)
          Locate and load the band with the given name.
 Instrument searchInstrument(java.lang.String instrname)
          Returns the instrument with the given instrument name or NULL if there is no instrument with the given name.
 Keyword searchKeyword(java.lang.String keyworddesc)
          Find a keyword matching the given keyword-string.
 java.util.List<Playlist> searchPlaylist(java.lang.String playlistname)
          Find a playlist matching the given name.
 Playlist songsByBand(long bandid)
           
 Playlist songsByKeyword(long keywordid)
           
 Playlist songsByKeywordbags(java.util.List<Keywordbag> bags, IUser user, int maxResults)
          Generates a Playlist containing songs that belong to the specified Keywordbags.
 Playlist songsByKeywordIds(java.util.List<java.lang.Long> keywordIds, IUser user)
           
 Playlist songsByKeywords(java.util.List<Keyword> keywords, IUser user)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateDao

public HibernateDao()
Method Detail

getSongIds

public java.util.List<java.lang.Long> getSongIds()
Specified by:
getSongIds in interface Dao

getSongById

public Song getSongById(long id)
Description copied from interface: Dao
Retrieves the song with the given id from the database.

Specified by:
getSongById in interface Dao
Parameters:
id - The song id.
Returns:
The song with the given identifier.

getSongsById

public java.util.List<Song> getSongsById(java.util.Collection<java.lang.Long> ids)
Description copied from interface: Dao
Retrieves a number of songs from the database, corresponding with the given Ids.

Specified by:
getSongsById in interface Dao
Parameters:
ids - The ids to get. This must not be null.
Returns:
A List of Song-objects

getBandById

public Band getBandById(long id)
Description copied from interface: Dao
Retrieves the band with the given id from the database.

Specified by:
getBandById in interface Dao
Parameters:
id - The band id.
Returns:
The band with the given identifier.

getBandByName

public Band getBandByName(java.lang.String name)
Description copied from interface: Dao
Retrieves the band with the given name from the database. If there ares more than one Band with this name, the result is the Band that has been in the Database longest.

Specified by:
getBandByName in interface Dao
Parameters:
name - The band name.
Returns:
The band with the given name.

getKeywordById

public Keyword getKeywordById(long id)
Description copied from interface: Dao
Retrieves the keyword with the given id from the database.

Specified by:
getKeywordById in interface Dao
Parameters:
id - The keyword id.
Returns:
The keyword with the given identifier.

getKeywordBagById

public Keywordbag getKeywordBagById(long id)
Description copied from interface: Dao
Retrieves the keyword bag with the given id from the database.

Specified by:
getKeywordBagById in interface Dao
Parameters:
id - The keyword bag id.
Returns:
The keyword bagwith the given identifier.

getArtistById

public Artist getArtistById(long id)
Description copied from interface: Dao
Retrieves the artist with the given id from the database.

Specified by:
getArtistById in interface Dao
Parameters:
id - The artist id.
Returns:
The artist with the given identifier.

getAIBagById

public AIBag getAIBagById(long id)
Description copied from interface: Dao
Retrieves the ai_bag with the given id from the database.

Specified by:
getAIBagById in interface Dao
Parameters:
id - The ai_bag id.
Returns:
The ai_bag with the given identifier.

searchArtist

public Artist searchArtist(java.lang.String artistfirstname,
                           java.lang.String artistlastname)
Description copied from interface: Dao
Find an artist matching the given first and last name.

Specified by:
searchArtist in interface Dao
Parameters:
artistfirstname - The desired artist name. May be null.
artistlastname - The desired artist last name. The result is null if this is null.
Returns:
An artist with the desired name or null if it does not exist.

getArtistAppearances

public AIBag getArtistAppearances(long artistid)
Description copied from interface: Dao
Return a list of all appearances of an artist in songs.

Specified by:
getArtistAppearances in interface Dao
Parameters:
artistid - The artist to search.
Returns:

getInstrumentById

public Instrument getInstrumentById(long id)
Description copied from interface: Dao
Retrieves the instrument with the given id from the database.

Specified by:
getInstrumentById in interface Dao
Parameters:
id - The instrument id.
Returns:
The instrument with the given identifier.

getSong

public Song getSong(Band band,
                    java.lang.String songname)
Description copied from interface: Dao
Find a song with the given name performed by the specified band. If there is more than 1 song matching the name and band, this method returns one of them. Returns if a matching song does not exist.

Specified by:
getSong in interface Dao
Parameters:
band - The band
songname - The song name.
Returns:
A song matching the band and song name, or NULL if there is no such song.

songsByBand

public Playlist songsByBand(long bandid)
Specified by:
songsByBand in interface Dao

search

public java.util.List search(java.lang.String hql,
                             java.util.Map<java.lang.String,java.lang.Object> params,
                             int maxResults)
Description copied from interface: Dao
Searches in the Database, and returns the objects that were selected.

Specified by:
search in interface Dao
Parameters:
hql - The HQL-query.
params - Query parameters as name,value pairs
maxResults - The maximum amount of objects to return. Use 0 for all results.
Returns:
The objects that fit to the search-query.

search

public java.util.List search(java.lang.String hql,
                             java.util.Map<java.lang.String,java.lang.Object> params,
                             int maxResults,
                             int offset)
Description copied from interface: Dao
Searches in the Database, and returns the objects that were selected.

Specified by:
search in interface Dao
Parameters:
hql - The HQL-query.
params - Query parameters as name,value pairs
maxResults - The maximum amount of objects to return. Use 0 for all results.
offset - The first offset objects will not be returned
Returns:
The objects that fit to the search-query.

searchBand

public Band searchBand(java.lang.String bandname)
Description copied from interface: Dao
Locate and load the band with the given name. Returns NULL if there is no band with the given name. If there are more bands with this name this method returns one of them.

Specified by:
searchBand in interface Dao
Parameters:
bandname - The band name.
Returns:
The band with the given name.

searchKeyword

public Keyword searchKeyword(java.lang.String keyworddesc)
Description copied from interface: Dao
Find a keyword matching the given keyword-string.

Specified by:
searchKeyword in interface Dao
Parameters:
keyworddesc - The desired keyword string.
Returns:
A keyword with the desired text or null if it does not exist.

searchPlaylist

public java.util.List<Playlist> searchPlaylist(java.lang.String playlistname)
Description copied from interface: Dao
Find a playlist matching the given name. The search is case sensitive. Returns an empty list if the playlist name parameter is null or if no playlist with that name exists.

Specified by:
searchPlaylist in interface Dao
Parameters:
playlistname - The desired playlist name.
Returns:
A playlist with the desired name or null if it does not exist.

save

public void save(Band band)
Description copied from interface: Dao
Persist the properties of this band.

Specified by:
save in interface Dao
Parameters:
band - The band to persist.

save

public void save(Keyword keyword)
Description copied from interface: Dao
Persist the properties of this keyword.

Specified by:
save in interface Dao
Parameters:
keyword - The keyword to persist.

save

public void save(Keywordbag keywordbag)
Description copied from interface: Dao
Persist a keyword bag.

Specified by:
save in interface Dao
Parameters:
keywordbag - The keyword bag to persist.

save

public void save(Playlist playlist)
Description copied from interface: Dao
Persist the properties of this playlist.

Specified by:
save in interface Dao
Parameters:
playlist - The playlist to persist.

save

public void save(Link link)
Description copied from interface: Dao
Persist the properties of this link.

Specified by:
save in interface Dao
Parameters:
link - The link to persist.

save

public void save(Song song)
Description copied from interface: Dao
Persist the properties of this song.

Specified by:
save in interface Dao
Parameters:
song - The song to persist.

save

public void save(Artist artist)
Description copied from interface: Dao
Persist the properties of this artist.

Specified by:
save in interface Dao
Parameters:
artist - The artist to persist.

save

public void save(Instrument instr)
Description copied from interface: Dao
Persist the properties of this Instrument.

Specified by:
save in interface Dao
Parameters:
instr - The instrument to persist.

save

public void save(AIBag aibag)
Description copied from interface: Dao
Persist the properties of this AIBag.

Specified by:
save in interface Dao
Parameters:
aibag - The AIBag to persist.

findUserByName

public IUser findUserByName(java.lang.String username)
Description copied from interface: Dao
Searches for a User, and returns if, if found.

Specified by:
findUserByName in interface Dao
Parameters:
username - The username to search for
Returns:
The User, or null if no User with a matching name could be found

getPlaylistByName

public Playlist getPlaylistByName(java.lang.String name)
Description copied from interface: Dao
Retrieves the Playlist with the given name from the database. If there are more than one Playlists with this name, the result is the Playlist that has been in the Database longest.

Specified by:
getPlaylistByName in interface Dao
Parameters:
name - The playlist name.
Returns:
The Playlist with the given name.

getPlaylistById

public Playlist getPlaylistById(long id,
                                IUser user)
Description copied from interface: Dao
Returns a specific Playlist

Specified by:
getPlaylistById in interface Dao
Parameters:
id - The requested playlist id.
user - The user to use for retrieving "special" playlists.
Returns:
The Playlist, or null if a Playlist with the given id doesn't exist.

getForgottenSongs

protected Playlist getForgottenSongs(IUser user)
Lists a maximum amount of 25 Songs, with the following properties: The list is ordered to the plays/year ratio.

Parameters:
user - The User for who to create this list for (may be null).
Returns:
A Playlist, containing at most 25 Songs.

getUserById

public IUser getUserById(long userId)
Description copied from interface: UserDao
Get a User by specifying its id.

Specified by:
getUserById in interface UserDao
Parameters:
userId - The id.
Returns:
The User that has this id, or null of there is no such User.

findUserByNamePassword

public IUser findUserByNamePassword(java.lang.String username,
                                    java.lang.String password)
Description copied from interface: UserDao
Get a Particpant by specifying its loginname ans encrypted password

Specified by:
findUserByNamePassword in interface UserDao
Parameters:
username - The loginname
password - The encrypted password
Returns:
The User that has this loginname and password, or null if there is no such User.

listUsers

public java.util.List<IUser> listUsers()
Description copied from interface: UserDao
List all Users.

Specified by:
listUsers in interface UserDao
Returns:
All User-objects that exist, ordered by loginname.

findUserByLoginname

public java.util.List<IUser> findUserByLoginname(java.lang.String loginname)
Description copied from interface: UserDao
List Users by specifying a certain loginname

Specified by:
findUserByLoginname in interface UserDao
Parameters:
loginname - The loginname.
Returns:
A List of all Users that have this loginname (can be 0 or 1).

getUserByLoginname

public IUser getUserByLoginname(java.lang.String inlognaam)
Description copied from interface: UserDao
Get a User by specifying its loginname

Specified by:
getUserByLoginname in interface UserDao
Parameters:
inlognaam - The loginname.
Returns:
The User that has this loginname, or null if there is no such User.

save

public void save(IUser user)
Description copied from interface: UserDao
Persists a User-object.

Specified by:
save in interface UserDao
Parameters:
user - The User to persist.

delete

public void delete(IUser user)
Description copied from interface: UserDao
Deletes a User-object.

Specified by:
delete in interface UserDao
Parameters:
user - The User to purge from persistent storage.

getRoleById

public Role getRoleById(int roleId)

listRoles

public java.util.List<Role> listRoles()
Specified by:
listRoles in interface UserDao
Returns:
A list of all roles.

save

public void save(Role role)

getAuthorityById

public Authority getAuthorityById(int authorityId)

listAuthorities

public java.util.List<Authority> listAuthorities()

save

public void save(Authority authority)

listPlaylists

public java.util.List<Playlist> listPlaylists(Band band)
Description copied from interface: Dao
Lists all playlists on which a band is present.

Specified by:
listPlaylists in interface Dao
Parameters:
band - The Band to search Playlists for.
Returns:
A list of Playlists on which songs exist of the Band

listPlaylists

public java.util.List<Playlist> listPlaylists(Song song)
Specified by:
listPlaylists in interface Dao

listPlaylists

public java.util.List<Playlist> listPlaylists()
Description copied from interface: Dao
Lists all Playlists.

Specified by:
listPlaylists in interface Dao
Returns:
All Playlists.

listPodcasts

public java.util.List<Playlist> listPodcasts()
Description copied from interface: Dao
Lists all Playlists that contain Podcasts.

Specified by:
listPodcasts in interface Dao
Returns:
All Playlists that contain Podcasts.

evictSong

public void evictSong(long songId)
Specified by:
evictSong in interface Dao

evict

public void evict(java.lang.Object o)
Specified by:
evict in interface Dao

listBands

public java.util.List<java.lang.Object[]> listBands(IUser user)
Specified by:
listBands in interface Dao
Parameters:
user - The User to get this list for.
Returns:
Returns a list of String-arrays. The first element of the array is the bandId. The second element is the bandname, the third element is the amount of play-events for that band for the given User during the last year, the fourth element en the amount of skip-events for that band during the last year.

listKeywords

public java.util.List<Keyword> listKeywords()
Description copied from interface: Dao
Lists all known Keywords.

Specified by:
listKeywords in interface Dao
Returns:
All Keywords in no particular order.

listKeywords

public java.util.List<java.lang.Object[]> listKeywords(IUser user,
                                                       java.util.List<Keywordbag> bags)
Specified by:
listKeywords in interface Dao
Parameters:
user - The User to get this list for.
bags - The Keywordbags to show Keywords of (or null to show all keywords)
Returns:
Returns a list of String-arrays. The first element of the array is the keywordId. The second element is the keywordname, the third element is the amount of play-events for that keyword for the given User during the last year, the fourth element is the amount of skip-events for that keyword during the last year. If the bags parameter is non-null, then only keywords occurring in the ketword bags in bags are included.

listKeywordsBags

public java.util.List<Keywordbag> listKeywordsBags(java.util.List<Keyword> keywords)
Description copied from interface: Dao
Returns a list with all keyword bags that contain at least all keywords given in the "keywords" parameter.

Specified by:
listKeywordsBags in interface Dao
Parameters:
keywords - The list of keywords that hava to be present in each keyword bag in the result. If this parameter is null or empty, the result is null.
Returns:
A list of Keywordbags containing all keywords given.

getKeywordsBag

public Keywordbag getKeywordsBag(java.util.Collection<Keyword> keywords)
Specified by:
getKeywordsBag in interface Dao
Returns:
A list of Keywordbags containing exactly all keywords given, no more, no less.

songsByKeywordbags

public Playlist songsByKeywordbags(java.util.List<Keywordbag> bags,
                                   IUser user,
                                   int maxResults)
Description copied from interface: Dao
Generates a Playlist containing songs that belong to the specified Keywordbags. The songs in the Playlist are ordered by the amount of play-events of the specified User during the last year.

Specified by:
songsByKeywordbags in interface Dao
Parameters:
bags - The Keywordbag(s) the Song could be in. If this parameter is null, an empty Playlist is returned.
user - The User-object (Used for sorting according to listening-habits). If this parameter is null, anonymous sorting is used.
maxResults - Specifiec the maximum amount of records to return. Pass a value >0 to show all matches.
Returns:
A Playlist consisting of Songs that matched any of the given Keywordbags.

songsByKeyword

public Playlist songsByKeyword(long keywordid)
Specified by:
songsByKeyword in interface Dao

songsByKeywords

public Playlist songsByKeywords(java.util.List<Keyword> keywords,
                                IUser user)
Specified by:
songsByKeywords in interface Dao

songsByKeywordIds

public Playlist songsByKeywordIds(java.util.List<java.lang.Long> keywordIds,
                                  IUser user)
Specified by:
songsByKeywordIds in interface Dao

listKeywordbags

public java.util.List<Keywordbag> listKeywordbags()
Description copied from interface: Dao
Returns a list of all Keyword bags.

Specified by:
listKeywordbags in interface Dao
Returns:
A list of all keyword bags.

getNeighbours

public Playlist getNeighbours(long songid,
                              IUser user)
Description copied from interface: Dao
Returns a Playlist containing Songs that are neighbours of the given Song and User. Neighbours are Songs that are played or requested at least five times 10 minutes before or after this song was played or requested. The resulting Playlist is sorted by the amount of 'together-played'-hits.

Specified by:
getNeighbours in interface Dao
Parameters:
songid - The Song to get the neighbours for.
user - The User for whom to inspect the played and requested-Events
Returns:
A Playlist, containing the Neighbouring Songs.

getDoubleSongs

public java.util.List<java.lang.Long[]> getDoubleSongs()
Description copied from interface: Dao
Searches the database for songs that are stored more than one time in the database.

Specified by:
getDoubleSongs in interface Dao
Returns:
A List of Long-pairs with songIDs.

mergeSongs

public void mergeSongs(Song keep,
                       Song remove)
Description copied from interface: Dao
Merges two songs to one. All events, occurences on playlists, etc. will be merged.

Specified by:
mergeSongs in interface Dao
Parameters:
keep - This song stays.
remove - This song will be removed.

mergeBands

public void mergeBands(Band keep,
                       Band remove)
Description copied from interface: Dao
Merge two bands, moving all songs from one to the other. The artists relations of the removed band are lost.

Specified by:
mergeBands in interface Dao
Parameters:
keep - Keep this band. Add all songs of the other band to this band.
remove - The band to remove, moving all songs to the other band.

searchInstrument

public Instrument searchInstrument(java.lang.String instrname)
Description copied from interface: Dao
Returns the instrument with the given instrument name or NULL if there is no instrument with the given name.

Specified by:
searchInstrument in interface Dao
Parameters:
instrname - The intsrument name.
Returns:
The instrument with the given name.

count

public int count(java.lang.String hql,
                 java.util.Map<java.lang.String,java.lang.Object> params)
          throws java.lang.Exception
Specified by:
count in interface Dao
Throws:
java.lang.Exception

listMonthlySongCounts

public java.util.List<java.lang.Object[]> listMonthlySongCounts()
Specified by:
listMonthlySongCounts in interface Dao
Returns:
Returns a list of String-arrays. The first element of the array is the month, the second element is the year and the third element is the amount of songs that were added to the database in that month.

listMonthlyStatistics

public java.util.Map<java.lang.String,java.lang.Integer> listMonthlyStatistics(IUser user)
Description copied from interface: Dao
Returns per-user play-statistics. This method queries the database, and returns a Map containing String -> Integer relations. These releations are constructed as follows: "yyyy,mm,k" -> x where mm is the month, yyyy is the year, k is the eventkind and x is the amount of such events

Specified by:
listMonthlyStatistics in interface Dao
Parameters:
user - The user to gather these statistics for.
Returns:
The Map as stated above. The order of the keys in the returned map is guaranteed to be alphabetical.
See Also:
Event

listNamableItems

public java.util.List<java.lang.Object[]> listNamableItems()
Specified by:
listNamableItems in interface Dao
Returns:
Returns a list of Object-arrays. The first element of the array is the name (String) of a namable item. The second is the id (Long). Namable items are all items in the database that both have a name and an id. (Bands, Artists, Playlists, Songs, Instruments, Keywords)

getMostUsedAIBag

public AIBag getMostUsedAIBag(Band band)
Description copied from interface: Dao
Searches the database for the most used AIBag for this band. This comes in handy when a user needs to have a hint for which artists and instruments to choose for a new song.

Specified by:
getMostUsedAIBag in interface Dao
Parameters:
band - The Band
Returns:
A suggestion for a AIBag for a new song of this band.

listAIBags

public java.util.List<AIBag> listAIBags()
Description copied from interface: Dao
Returns a list of all Artist-Instrument bags.

Specified by:
listAIBags in interface Dao
Returns:
A list of all Artist-Instrument bags.

mergePlaylists

public void mergePlaylists(Playlist keep,
                           Playlist delete)
Description copied from interface: Dao
Merge the two playlists into one. There is no effect if one or both of the arguments are null.

Specified by:
mergePlaylists in interface Dao
Parameters:
keep - This playlist will receive all songs from the other playlist.
delete - This The songs of this playlist will be moved to the other playlist and this playlist will be deleted.

deleteArtist

public void deleteArtist(Artist delete)
Description copied from interface: Dao
Deletes an artist. Nothing happens if the 'delete' argument is null.

Specified by:
deleteArtist in interface Dao
Parameters:
delete - The artist to delete.

deleteAiBag

public void deleteAiBag(AIBag delete)
Description copied from interface: Dao
Deletes an AIBag. Nothing happens if the 'delete' argument is null.

Specified by:
deleteAiBag in interface Dao
Parameters:
delete - The AIBag to delete.

getSessionFactory2

public org.hibernate.SessionFactory getSessionFactory2()
Description copied from interface: Dao
Returns the SessionFactory.

Specified by:
getSessionFactory2 in interface Dao
Returns:
The SessionFactory.

registerSongChangeListener

public void registerSongChangeListener(SongChangeListener listener)
Description copied from interface: Dao
Adds a SongChangeListener to the internal list of listeners. The listener will be informed about all Song-changes that happen after registration.

Specified by:
registerSongChangeListener in interface Dao
Parameters:
listener - The SongChangeListener to register.

getSupport

public org.springframework.orm.hibernate3.HibernateTemplate getSupport()
Specified by:
getSupport in interface Dao


Copyright © 2010 A.J.V.. All Rights Reserved.