public class TraceSequenceDAO extends HibernateRepository<TraceSequence>
TraceSequence
sConstructor and Description |
---|
TraceSequenceDAO() |
Modifier and Type | Method and Description |
---|---|
TraceSequence |
create(Path traceDir,
TraceSequence traceSequence,
InputStream inputStream)
Create a new
TraceSequence object in the database, and write the file data to disk. |
void |
delete(Path tracesDir,
TraceSequence traceSequence)
Delete the trace file from the referenced directory and if that succeeds, deletes the given
TraceSequence object in the database |
TraceSequence |
get(long id) |
List<TraceSequence> |
getByEntry(Entry entry,
int start,
int limit)
Retrieve all
TraceSequence objects associated with the given Entry object
using the paging parameters, ordered by creation time in ascending order |
Optional<TraceSequence> |
getByFileId(String fileId)
Retrieve the
TraceSequence object by its fileId. |
int |
getCountByEntry(Entry entry)
Get number of trace sequences available for specified entry
|
TraceSequence |
save(TraceSequence traceSequence)
Save the given
TraceSequence object in the database. |
create, currentSession, delete, get, getBuilder, update
public TraceSequence create(Path traceDir, TraceSequence traceSequence, InputStream inputStream)
TraceSequence
object in the database, and write the file data to disk.traceDir
- storage directory for the new trace sequence filetraceSequence
- information about the new file to store, including a unique identifierinputStream
- byte stream for fileDAOException
- if the filename for the new trace sequence already exists or if there is an error savingpublic TraceSequence save(TraceSequence traceSequence)
TraceSequence
object in the database.traceSequence
- object to saveDAOException
- on hibernate exception savingpublic Optional<TraceSequence> getByFileId(String fileId)
TraceSequence
object by its fileId.fileId
- unique file identifierOptional
container that contains the trace sequence if found.DAOException
public void delete(Path tracesDir, TraceSequence traceSequence)
TraceSequence
object in the databasetracesDir
- directory for trace filestraceSequence
- trace object to delete from databaseDAOException
- on hibernate or IO Exception when attempting to save the trace sequence object
orpublic List<TraceSequence> getByEntry(Entry entry, int start, int limit)
TraceSequence
objects associated with the given Entry
object
using the paging parameters, ordered by creation time in ascending orderentry
- entry whose trace sequences are being retrievedstart
- start for traces retrievallimit
- maximum number of trace records to retrieveDAOException
public int getCountByEntry(Entry entry)
entry
- entry whose entry count is being retrievedpublic TraceSequence get(long id)
Copyright © 2017. All rights reserved.