public class SequenceDAO extends HibernateRepository<Sequence>
Sequence
and associated objects in the database.Constructor and Description |
---|
SequenceDAO() |
Modifier and Type | Method and Description |
---|---|
void |
deleteSequence(Sequence sequence,
String pigeonImageFolder)
Delete the given
Sequence object in the database. |
Sequence |
get(long id) |
Sequence |
getByEntry(Entry entry)
|
Sequence |
getSequence(int offset)
Enables retrieving sequences in the database without loading everything in memory
Expected usage is
long count = getSequenceCount();
int offset = 0;
while( offset < count ) {
Sequence sequence = dao.getSequence(offset);
// do something with sequence
}
|
int |
getSequenceCount() |
String |
getSequenceFilename(Entry entry) |
Optional<String> |
getSequenceString(Entry entry) |
boolean |
hasOriginalSequence(long entryId)
Determines if the user uploaded a sequence file and associated it with an entry
|
boolean |
hasSequence(long entryId) |
Sequence |
saveSequence(Sequence sequence)
Save the given
Sequence object in the database. |
Sequence |
updateSequence(Sequence sequence,
Set<SequenceFeature> newFeatures)
Updates an existing feature with a new set of features
|
create, currentSession, delete, get, getBuilder, update
public Sequence saveSequence(Sequence sequence)
Sequence
object in the database.sequence
- sequence to saveIllegalArgumentException
- if the sequence object is null or does not have a valid entry associated with itDAOException
public Sequence updateSequence(Sequence sequence, Set<SequenceFeature> newFeatures)
sequence
- existing feature to updatenewFeatures
- optional new set of features that need updating. If this is null, the features associated with
the specified sequence is clearedIllegalArgumentException
- if sequence is null or does not have an associated entrypublic void deleteSequence(Sequence sequence, String pigeonImageFolder)
Sequence
object in the database.sequence
- sequence to deletepigeonImageFolder
- path of the image folder where the pigeon images are cachedpublic Sequence getByEntry(Entry entry)
entry
- entry associated with sequencepublic boolean hasSequence(long entryId)
public boolean hasOriginalSequence(long entryId)
entryId
- unique identifier for entryDAOException
public Sequence getSequence(int offset)
long count = getSequenceCount();
int offset = 0;
while( offset < count ) {
Sequence sequence = dao.getSequence(offset);
// do something with sequence
}
DAOException
public int getSequenceCount()
public Sequence get(long id)
Copyright © 2017. All rights reserved.