Search in sources :

Example 1 with TraceSequenceAlignment

use of org.jbei.ice.storage.model.TraceSequenceAlignment in project ice by JBEI.

the class TraceSequenceDAO method save.

/**
     * Save the given {@link TraceSequence} object in the database.
     *
     * @param traceSequence object to save
     * @return Saved TraceSequence object.
     * @throws DAOException on hibernate exception saving
     */
public TraceSequence save(TraceSequence traceSequence) {
    TraceSequenceAlignment traceSequenceAlignment = traceSequence.getTraceSequenceAlignment();
    Session session = currentSession();
    try {
        session.saveOrUpdate(traceSequenceAlignment);
        traceSequence.setTraceSequenceAlignment(traceSequenceAlignment);
        session.saveOrUpdate(traceSequence);
        return traceSequence;
    } catch (HibernateException e) {
        throw new DAOException("Error saving trace sequence", e);
    }
}
Also used : DAOException(org.jbei.ice.storage.DAOException) TraceSequenceAlignment(org.jbei.ice.storage.model.TraceSequenceAlignment) HibernateException(org.hibernate.HibernateException) Session(org.hibernate.Session)

Aggregations

HibernateException (org.hibernate.HibernateException)1 Session (org.hibernate.Session)1 DAOException (org.jbei.ice.storage.DAOException)1 TraceSequenceAlignment (org.jbei.ice.storage.model.TraceSequenceAlignment)1