@SuppressWarnings("unchecked") @DeleteIdentifiedOperation public synchronized void deleteIdentifiedListsForWFRun(String workflowRunId) throws DaoException { try{ // Select all T2Reference lists for this wf run Session session = getSession(); Query selectQuery= session.createQuery("FROM T2ReferenceListImpl WHERE namespacePart=:workflow_run_id"); selectQuery.setString("workflow_run_id", workflowRunId); List<IdentifiedList<T2Reference>> identifiedLists = selectQuery.list(); session.close(); // need to close before we do delete otherwise hibernate complains that two sessions are accessing collection getHibernateTemplate().deleteAll(identifiedLists); } catch(Exception ex){ throw new DaoException(ex); } } }
public boolean delete( IdentifiedList<T2Reference> theList) throws DaoException { if (theList.getId() == null) { throw new DaoException("Supplied list set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theList.getId().getReferenceType().equals( T2ReferenceType.IdentifiedList) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.IdentifiedList, something has probably " + "gone badly wrong somewhere earlier!"); } if (theList instanceof T2ReferenceListImpl) { try { getHibernateTemplate().delete(theList); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied identifier list not an instance of T2ReferenceList"); } return true; }
@PutIdentifiedOperation public void store(IdentifiedList<T2Reference> theList) throws DaoException { if (theList.getId() == null) { throw new DaoException("Supplied list set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theList.getId().getReferenceType().equals( T2ReferenceType.IdentifiedList) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.IdentifiedList, something has probably " + "gone badly wrong somewhere earlier!"); } if (theList instanceof T2ReferenceListImpl) { try { getHibernateTemplate().save(theList); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied identifier list not an instance of T2ReferenceList"); } }
return (T2ReferenceListImpl) getHibernateTemplate().get( T2ReferenceListImpl.class, ((T2ReferenceImpl) ref).getCompactForm());
@PutIdentifiedOperation public void store(IdentifiedList<T2Reference> theList) throws DaoException { if (theList.getId() == null) { throw new DaoException("Supplied list set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theList.getId().getReferenceType().equals( T2ReferenceType.IdentifiedList) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.IdentifiedList, something has probably " + "gone badly wrong somewhere earlier!"); } if (theList instanceof T2ReferenceListImpl) { try { getHibernateTemplate().save(theList); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied identifier list not an instance of T2ReferenceList"); } } }
return (T2ReferenceListImpl) getHibernateTemplate().get( T2ReferenceListImpl.class, ((T2ReferenceImpl) ref).getCompactForm());
@PutIdentifiedOperation public void store(IdentifiedList<T2Reference> theList) throws DaoException { if (theList.getId() == null) { throw new DaoException("Supplied list set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theList.getId().getReferenceType().equals( T2ReferenceType.IdentifiedList) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.IdentifiedList, something has probably " + "gone badly wrong somewhere earlier!"); } if (theList instanceof T2ReferenceListImpl) { try { getHibernateTemplate().save(theList); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied identifier list not an instance of T2ReferenceList"); } } }
return (T2ReferenceListImpl) getHibernateTemplate().get( T2ReferenceListImpl.class, ((T2ReferenceImpl) ref).getCompactForm());