public interface NoteDao
Note
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFORM_NONE
This constant is used as a transformation flag; entities can be converted automatically into
value objects or other types, different methods in a class implementing this interface
support this feature: look for an
int parameter called transform . |
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<?> |
create(int transform,
Collection<Note> entities)
Does the same thing as
create(Note) with an additional flag called
transform . |
Object |
create(int transform,
Note note)
Does the same thing as
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.
|
Note |
forceLoad(Long id)
Load a note from the persistent store, even if it is cached.
|
Long |
getAutosave(Long userId,
Long noteId,
Long parentNoteId,
Collection<StringPropertyFilter> filters)
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.
|
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.
|
boolean |
hasInconsistentTopics(Long discussionId,
Long topicId)
Test whether a discussion has notes which do not have the provided topic.
|
Object |
load(int transform,
Long id)
Does the same thing as
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
loadAll() with an additional flag called
transform . |
void |
moveToTopic(Long discussionId,
Blog newTopic)
Moves the given discussion to the given topic.
|
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 |
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.
|
static final int TRANSFORM_NONE
int
parameter called transform
.
This specific flag denotes no transformation will occur.Collection<Note> create(Collection<Note> entities)
entities
collectionentities
- the collection of Note instances to create.Collection<?> create(int transform, Collection<Note> entities)
Does the same thing as 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.
Object create(int transform, Note note)
Does the same thing as 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.
void evict(Note entity)
entity
- the entity to evictNote findLatestNote()
Returns the note with highest ID.
Note findNearestNote(long noteId, Date creationDate, boolean younger)
Returns the nearest note to the given Id.
Note forceLoad(Long id)
id
- the ID of the note to loadLong getAutosave(Long userId, Long noteId, Long parentNoteId, Collection<StringPropertyFilter> filters)
Tries 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.
Collection<Long> getFavoriteNoteIds(Long userId, Long lowerBound, Long upperBound)
Returns the favorite notes of the given user within the given range.
List<Long> getNoteIdsOfDiscussion(Long discussionId)
Returns the IDs of the notes of the discussion. The result does not include the root note of the discussion.
long getNotesCount()
Gets the count of all notes
List<Note> getNotesForBlog(Long blogId, Long firstNoteId, Integer limit)
int getNumberOfFavorites(Long noteId)
Returns how often a note is favorized.
noteId
- the note to checkboolean hasInconsistentTopics(Long discussionId, Long topicId)
discussionId
- ID of the discussiontopicId
- the ID of the topic to testObject load(int transform, Long id)
Does the same thing as 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.
id
- the identifier of the entity to load.Collection<Note> loadAll()
Note
.Collection<?> loadAll(int transform)
Does the same thing as 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.
transform
- the flag indicating what transformation to use.void moveToTopic(Long discussionId, Blog newTopic)
discussionId
- The discussion to move.newTopic
- The new topic of the discussion.void remove(Collection<Note> entities)
entities collection.
void remove(Long id)
identifier
from the persistent
store.void remove(Note note)
void update(Collection<Note> entities)
entities
collection in the persistent store.void update(Note note)
note
instance in the persistent store.void updateFollowableItems(Note note, boolean updateChildren)
Updates the followableItems of a Note to the current settings. Should be called after the note was updated/created.
updateChildren
- If true, childrens will be updated too.Copyright © 2019 Communote team. All rights reserved.