public abstract class NoteDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements NoteDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
Note.
NoteTRANSFORM_NONE| Constructor and Description |
|---|
NoteDaoBase() |
| Modifier and Type | Method and Description |
|---|---|
Collection<Note> |
create(Collection<Note> entities)
Creates a new instance of Note and adds from the passed in
entities collection |
Collection<Note> |
create(int transform,
Collection<Note> entities)
Does the same thing as
NoteDao.create(Note) with an additional flag called
transform. |
Object |
create(int transform,
Note note)
Does the same thing as
NoteDao.create(Note) with an additional flag called
transform. |
Note |
create(Note note)
Creates an instance of Note and adds it to the persistent store.
|
void |
evict(Note entity)
Evicts (removes) the entity from the hibernate cache
|
Note |
findLatestNote()
Returns the note with highest ID.
|
Note |
findNearestNote(long noteId,
Date creationDate,
boolean younger)
Returns the nearest note to the given Id.
|
Long |
getAutosave(Long userId,
Long noteId,
Long parentNoteId,
Collection<StringPropertyFilter> propertyfilters)
Tries to find an autosaved note of the given user.
|
Collection<Long> |
getFavoriteNoteIds(Long userId,
Long lowerBound,
Long upperBound)
Returns the favorite notes of the given user within the given range.
|
protected GlobalIdDao |
getGlobalIdDao()
Gets the reference to
globalIdDao. |
List<Long> |
getNoteIdsOfDiscussion(Long discussionId)
Returns the IDs of the notes of the discussion.
|
List<Note> |
getNotesByTag(Long tagId) |
long |
getNotesCount()
Gets the count of all notes
|
List<Note> |
getNotesForBlog(Long blogId,
Long firstNoteId,
Integer limit) |
List<Note> |
getNotesOfUser(Long userId) |
int |
getNumberOfFavorites(Long noteId)
Returns how often a note is favorized.
|
protected abstract Note |
handleFindLatestNote()
Performs the core logic for
findLatestNote() |
protected abstract Note |
handleFindNearestNote(long noteId,
Date creationDate,
boolean younger)
Performs the core logic for
findNearestNote(long, java.util.Date, boolean) |
protected abstract Long |
handleGetAutosave(Long userId,
Long noteId,
Long parentNoteId,
Collection<StringPropertyFilter> propertyFilters)
Performs the core logic for
getAutosave(Long, Long, Long, Collection) |
protected abstract Collection<Long> |
handleGetFavoriteNoteIds(Long userId,
Long lowerBound,
Long upperBound)
Performs the core logic for
getFavoriteNoteIds(Long, Long, Long) |
protected abstract List<Long> |
handleGetNoteIdsOfDiscussion(Long discussionId)
Performs the core logic for
getNoteIdsOfDiscussion(Long) |
protected abstract List<Note> |
handleGetNotesByTag(Long tagId)
Performs the core logic for
getNotesByTag(Long) |
protected abstract long |
handleGetNotesCount()
Performs the core logic for
getNotesCount() |
protected abstract List<Note> |
handleGetNotesForBlog(Long blogId,
Long firstNoteId,
Integer limit)
Performs the core logic for
getNotesForBlog(Long, Long, Integer) |
protected abstract List<Note> |
handleGetNotesOfUser(Long userId)
Performs the core logic for
getNotesOfUser(Long) |
protected abstract int |
handleGetNumberOfFavorites(Long noteId) |
protected abstract void |
handleUpdateFollowableItems(Note note,
boolean updateChildren)
Performs the core logic for
#updateFollowableItems(Note) |
Object |
load(int transform,
Long id)
Does the same thing as
NoteDao.load(Long) with an additional flag called
transform. |
Note |
load(Long id)
Loads an instance of Note from the persistent store.
|
Collection<Note> |
loadAll()
Loads all entities of type
Note. |
Collection<?> |
loadAll(int transform)
Does the same thing as
NoteDao.loadAll() with an additional flag called
transform. |
void |
remove(Collection<Note> entities)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of Note having the given
identifier from the persistent
store. |
void |
remove(Note note)
Removes the instance of Note from the persistent store.
|
void |
setGlobalIdDao(GlobalIdDao globalIdDao)
Sets the reference to
globalIdDao. |
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,Note) method. |
protected Object |
transformEntity(int transform,
Note entity)
Allows transformation of entities into value objects (or something else for that matter),
when the
transform flag is set to one of the constants defined in
NoteDao, please note that the NoteDao.TRANSFORM_NONE constant denotes no
transformation, so the entity itself will be returned. |
void |
update(Collection<Note> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(Note note)
Updates the
note instance in the persistent store. |
void |
updateFollowableItems(Note note,
boolean updateChildren)
Updates the followableItems of a Note to the current settings.
|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforceLoad, hasInconsistentTopics, moveToTopicpublic Collection<Note> create(int transform, Collection<Note> entities)
NoteDao
Does the same thing as NoteDao.create(Note) with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entities (into value objects for example). By default,
transformation does not occur.
public Object create(int transform, Note note)
NoteDao
Does the same thing as NoteDao.create(Note) with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
create in interface NoteDaoNoteDao.create(int transform, Note)public Collection<Note> create(Collection<Note> entities)
NoteDaoentities collectionpublic Note create(Note note)
NoteDaocreate in interface NoteDaoNoteDao.create(Note)public void evict(Note entity)
public Note findLatestNote()
NoteDaoReturns the note with highest ID.
findLatestNote in interface NoteDaoNoteDao.findLatestNote()public Note findNearestNote(long noteId, Date creationDate, boolean younger)
NoteDaoReturns the nearest note to the given Id.
findNearestNote in interface NoteDaoNoteDao.findNearestNote(long, java.util.Date, boolean)public Long getAutosave(Long userId, Long noteId, Long parentNoteId, Collection<StringPropertyFilter> propertyfilters)
NoteDaoTries to find an autosaved note of the given user. If noteId is not null the returned autosave was created during an edit operation of that note. If noteId is null and parentNoteId is not null the returned autosave was created during an answer operation on that note.
getAutosave in interface NoteDaoNoteDao#getAutosave(Long, Long, Long,
com.communote.server.api.core.property.StringPropertyFilter[])public Collection<Long> getFavoriteNoteIds(Long userId, Long lowerBound, Long upperBound)
NoteDaoReturns the favorite notes of the given user within the given range.
getFavoriteNoteIds in interface NoteDaoNoteDao.getFavoriteNoteIds(Long, Long, Long)protected GlobalIdDao getGlobalIdDao()
globalIdDao.public List<Long> getNoteIdsOfDiscussion(Long discussionId)
NoteDaoReturns the IDs of the notes of the discussion. The result does not include the root note of the discussion.
getNoteIdsOfDiscussion in interface NoteDaoNoteDao.getNoteIdsOfDiscussion(Long)public List<Note> getNotesByTag(Long tagId)
getNotesByTag in interface NoteDaoNoteDao.getNotesByTag(Long)public long getNotesCount()
NoteDaoGets the count of all notes
getNotesCount in interface NoteDaoNoteDao.getNotesCount()public List<Note> getNotesForBlog(Long blogId, Long firstNoteId, Integer limit)
NoteDaogetNotesForBlog in interface NoteDaoNoteDao.getNotesForBlog(Long, Long, Integer)public List<Note> getNotesOfUser(Long userId)
getNotesOfUser in interface NoteDaoNoteDao.getNotesOfUser(Long)public int getNumberOfFavorites(Long noteId)
NoteDaoReturns how often a note is favorized.
getNumberOfFavorites in interface NoteDaonoteId - the note to checkNoteDao.getNumberOfFavorites(Long)protected abstract Note handleFindLatestNote()
findLatestNote()protected abstract Note handleFindNearestNote(long noteId, Date creationDate, boolean younger)
findNearestNote(long, java.util.Date, boolean)protected abstract Long handleGetAutosave(Long userId, Long noteId, Long parentNoteId, Collection<StringPropertyFilter> propertyFilters)
getAutosave(Long, Long, Long, Collection)protected abstract Collection<Long> handleGetFavoriteNoteIds(Long userId, Long lowerBound, Long upperBound)
getFavoriteNoteIds(Long, Long, Long)protected abstract List<Long> handleGetNoteIdsOfDiscussion(Long discussionId)
getNoteIdsOfDiscussion(Long)protected abstract List<Note> handleGetNotesByTag(Long tagId)
getNotesByTag(Long)protected abstract long handleGetNotesCount()
getNotesCount()protected abstract List<Note> handleGetNotesForBlog(Long blogId, Long firstNoteId, Integer limit)
getNotesForBlog(Long, Long, Integer)protected abstract List<Note> handleGetNotesOfUser(Long userId)
getNotesOfUser(Long)protected abstract int handleGetNumberOfFavorites(Long noteId)
protected abstract void handleUpdateFollowableItems(Note note, boolean updateChildren)
#updateFollowableItems(Note)public Object load(int transform, Long id)
NoteDao
Does the same thing as NoteDao.load(Long) with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation
which can optionally transform the entity (into a value object for example). By default,
transformation does not occur.
load in interface NoteDaoid - the identifier of the entity to load.NoteDao.load(int, Long)public Note load(Long id)
NoteDaoload in interface NoteDaoNoteDao.load(Long)public Collection<Note> loadAll()
NoteDaoNote.loadAll in interface NoteDaoNoteDao.loadAll()public Collection<?> loadAll(int transform)
NoteDao
Does the same thing as NoteDao.loadAll() with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
loadAll in interface NoteDaotransform - the flag indicating what transformation to use.NoteDao.loadAll(int)public void remove(Collection<Note> entities)
NoteDaoentities collection.public void remove(Long id)
NoteDaoidentifier from the persistent
store.remove in interface NoteDaoNoteDao.remove(Long)public void remove(Note note)
NoteDaoremove in interface NoteDaoNoteDao.remove(Note)public void setGlobalIdDao(GlobalIdDao globalIdDao)
globalIdDao.protected void transformEntities(int transform,
Collection<?> entities)
transformEntity(int,Note) method. This
method does not instantiate a new collection.
This method is to be used internally only.transform - one of the constants declared in NoteDaoentities - the collection of entities to transformtransformEntity(int,Note)protected Object transformEntity(int transform, Note entity)
transform flag is set to one of the constants defined in
NoteDao, please note that the NoteDao.TRANSFORM_NONE constant denotes no
transformation, so the entity itself will be returned.
If the integer argument value is unknown NoteDao.TRANSFORM_NONE is assumed.transform - one of the constants declared in NoteDaoentity - an entity that was foundtransformEntities(int,java.util.Collection)public void update(Collection<Note> entities)
NoteDaoentities collection in the persistent store.public void update(Note note)
NoteDaonote instance in the persistent store.update in interface NoteDaoNoteDao.update(Note)public void updateFollowableItems(Note note, boolean updateChildren)
NoteDaoUpdates the followableItems of a Note to the current settings. Should be called after the note was updated/created.
updateFollowableItems in interface NoteDaoupdateChildren - If true, childrens will be updated too.NoteDao#updateFollowableItems(Note)Copyright © 2019 Communote team. All rights reserved.