|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
magoffin.matt.dao.hbm.GenericHibernateDao<T,PK>
magoffin.matt.dao.hbm.GenericIndexableHibernateDao<Album,java.lang.Long>
magoffin.matt.ma2.dao.hbm.HibernateAlbumDao
public class HibernateAlbumDao
Hibernate implementation of AlbumDao.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class magoffin.matt.dao.hbm.GenericHibernateDao |
|---|
magoffin.matt.dao.hbm.GenericHibernateDao.UpdateMode |
| Field Summary | |
|---|---|
static java.lang.String |
QUERY_ALBUM_FOR_KEY
Find an Album based on its anonymous key. |
static java.lang.String |
QUERY_ALBUMS_FOR_THEME_ID
Find an Album based on a theme ID. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID
Find all Albums for a User ID. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_AND_NAME
Find all Albums for a User ID and name. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_BY_DATE
Find all Albums for a User ID, sorted by date in descending order. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_BY_DATE_SINCE
Find all Albums for a User ID, sorted by date in descending order, newer than a given date. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_FOR_ANONYMOUS_BY_DATE
Find all Albums for a User ID with 'allowAnonymous' = TRUE, sorted by date in descending order. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_FOR_BROWSE_BY_DATE
Find all Albums for a User ID with 'allowBrowse' = TRUE, sorted by date in descending order. |
static java.lang.String |
QUERY_ALBUMS_FOR_USER_ID_FOR_FEED_BY_DATE
Find all Albums for a User ID with 'allowFeed' = TRUE, sorted by date in descending order. |
static java.lang.String |
QUERY_PARAM_ITEM_ID
The HQL parameter name for a MediaItem ID. |
static java.lang.String |
QUERY_PARAM_SINCE_DATE
The HQL parameter name for the "since" date. |
static java.lang.String |
QUERY_PARAM_USER_ID
The HQL parameter name for a user ID. |
static java.lang.String |
QUERY_PARENT_ALBUM_FOR_ALBUM
Find the parent Album for a given Album. |
static java.lang.String |
QUERY_SHARED_ALBUMS_FOR_MEDIA_ITEM
Find all Albums that are shared and contain a MediaItem. |
static java.lang.String |
SEARCH_ALBUMS_FOR_USER_ID_FOR_FEED_BY_DATE
Find album search results for a User ID with 'allowFeed' = TRUE, sorted by date in descending order. |
| Fields inherited from class magoffin.matt.dao.hbm.GenericIndexableHibernateDao |
|---|
DEFAULT_INDEX_BATCH_SIZE |
| Fields inherited from class magoffin.matt.dao.hbm.GenericHibernateDao |
|---|
DEFAULT_BATCH_FLUSH_COUNT, log |
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
HibernateAlbumDao()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
delete(Album domainObject)
|
java.util.List<Album> |
findAlbumsForUser(java.lang.Long userId)
Find all top-level albums owned by a given user. |
java.util.List<Album> |
findAlbumsForUserAndName(java.lang.Long userId,
java.lang.String name)
Find top-level albums owned by a given user named a particular name. |
java.util.List<Album> |
findAlbumsForUserByDate(java.lang.Long userId,
java.util.Calendar since,
boolean anonymousOnly,
boolean browseOnly,
boolean feedOnly)
Find top-level albums owned by a given user, ordered in descending order by date, for all albums created on or since a given date. |
java.util.List<Album> |
findAlbumsForUserByDate(java.lang.Long userId,
int max,
boolean anonymousOnly,
boolean browseOnly,
boolean feedOnly)
Find top-level albums owned by a given user, ordered in descending order by date, with an optional maximum number of albums to return. |
java.util.List<Album> |
findSharedAlbumsContainingItem(MediaItem item)
Get a list of all Albums that contain a given MediaItem and are shared. |
Album |
getAlbumForKey(java.lang.String anonymousKey)
Get an Album for an anonymous key. |
Album |
getAlbumWithItems(java.lang.Long albumId)
Get an Album with it's items fully populated. |
Album |
getParentAlbum(java.lang.Long childAlbumId)
Get the parent album for another album. |
protected java.lang.Long |
getPrimaryKey(Album domainObject)
|
void |
init()
Initialize after properties configured. |
int |
reassignAlbumsUsingTheme(Theme oldTheme,
Theme newTheme)
Reassign all Albums using a particular Theme to a new Theme. |
| Methods inherited from class magoffin.matt.dao.hbm.GenericIndexableHibernateDao |
|---|
getIndexBatchSize, getIndexObjectIdColumnName, getIndexObjectTableAlias, getIndexRowMapper, getIndexTimeZone, getJdbcTemplate, getSqlIndexAll, getSqlIndexDateRange, getSqlParamIdxWithDateRange, index, populateIndexRow, setIndexBatchSize, setIndexObjectIdColumnName, setIndexObjectTableAlias, setIndexRowMapper, setIndexTimeZone, setJdbcTemplate, setSqlIndexAll, setSqlIndexDateRange, setSqlParamIdxWithDateRange |
| Methods inherited from class magoffin.matt.dao.hbm.GenericHibernateDao |
|---|
executeLiveCriteriaBatchCallback, executeNamedQueryBatchCallback, executeStatelessCriteriaBatchCallback, findByNamedQuery, findByNamedQuery, findByNamedQuery, findByNamedQuery, findByNamedQuery, get, getBatchFlushCount, getType, getUpdateMode, save, setBatchFlushCount, setUpdateMode, store, update |
| 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 |
| Methods inherited from interface magoffin.matt.dao.GenericDao |
|---|
get, store |
| Field Detail |
|---|
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_AND_NAME
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_BY_DATE
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_FOR_ANONYMOUS_BY_DATE
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_FOR_BROWSE_BY_DATE
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_FOR_FEED_BY_DATE
public static final java.lang.String SEARCH_ALBUMS_FOR_USER_ID_FOR_FEED_BY_DATE
public static final java.lang.String QUERY_ALBUMS_FOR_USER_ID_BY_DATE_SINCE
public static final java.lang.String QUERY_ALBUM_FOR_KEY
public static final java.lang.String QUERY_ALBUMS_FOR_THEME_ID
public static final java.lang.String QUERY_SHARED_ALBUMS_FOR_MEDIA_ITEM
public static final java.lang.String QUERY_PARENT_ALBUM_FOR_ALBUM
public static final java.lang.String QUERY_PARAM_USER_ID
public static final java.lang.String QUERY_PARAM_ITEM_ID
public static final java.lang.String QUERY_PARAM_SINCE_DATE
| Constructor Detail |
|---|
public HibernateAlbumDao()
| Method Detail |
|---|
public void init()
protected java.lang.Long getPrimaryKey(Album domainObject)
getPrimaryKey in class magoffin.matt.dao.hbm.GenericHibernateDao<Album,java.lang.Long>public java.util.List<Album> findAlbumsForUser(java.lang.Long userId)
AlbumDao
findAlbumsForUser in interface AlbumDaouserId - the ID of the user to find the albums for
public java.util.List<Album> findAlbumsForUserAndName(java.lang.Long userId,
java.lang.String name)
AlbumDao
findAlbumsForUserAndName in interface AlbumDaouserId - the ID of the user to find the albums forname - the name of the album to find
public Album getParentAlbum(java.lang.Long childAlbumId)
AlbumDao
getParentAlbum in interface AlbumDaochildAlbumId - the child album ID
public void delete(Album domainObject)
delete in interface magoffin.matt.dao.GenericDao<Album,java.lang.Long>delete in class magoffin.matt.dao.hbm.GenericHibernateDao<Album,java.lang.Long>public java.util.List<Album> findSharedAlbumsContainingItem(MediaItem item)
AlbumDao
findSharedAlbumsContainingItem in interface AlbumDaoitem - the item
public java.util.List<Album> findAlbumsForUserByDate(java.lang.Long userId,
java.util.Calendar since,
boolean anonymousOnly,
boolean browseOnly,
boolean feedOnly)
AlbumDao
findAlbumsForUserByDate in interface AlbumDaouserId - the ID of the user to find the albums forsince - the date to get albums sinceanonymousOnly - if true then only get albums which allow
anonymous accessbrowseOnly - if true then only get albums which allow
browse accessfeedOnly - if true then only get albums which allow
feed access
public java.util.List<Album> findAlbumsForUserByDate(java.lang.Long userId,
int max,
boolean anonymousOnly,
boolean browseOnly,
boolean feedOnly)
AlbumDao
findAlbumsForUserByDate in interface AlbumDaouserId - the ID of the user to find the albums formax - the maximum number of albums to return, if greater
than zero (otherwise return all albums)anonymousOnly - if true then only get albums which allow
anonymous accessbrowseOnly - if true then only get albums which allow
browse accessfeedOnly - if true then only get albums which allow
feed access
public Album getAlbumForKey(java.lang.String anonymousKey)
AlbumDao
getAlbumForKey in interface AlbumDaoanonymousKey - the anonymous key
public Album getAlbumWithItems(java.lang.Long albumId)
AlbumDao
getAlbumWithItems in interface AlbumDaoalbumId - the ID of the album
public int reassignAlbumsUsingTheme(Theme oldTheme,
Theme newTheme)
AlbumDao
reassignAlbumsUsingTheme in interface AlbumDaooldTheme - the Theme to search fornewTheme - the new Theme to replace the old Theme with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||