1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.dao.impl;
17
18 import java.sql.Timestamp;
19
20 import org.apache.log4j.Logger;
21 import org.apache.ojb.broker.query.Criteria;
22 import org.apache.ojb.broker.query.QueryFactory;
23 import org.kuali.rice.kns.bo.SessionDocument;
24 import org.kuali.rice.kns.dao.BusinessObjectDao;
25 import org.kuali.rice.kns.dao.SessionDocumentDao;
26 import org.kuali.rice.kns.util.KNSPropertyConstants;
27 import org.springframework.dao.DataAccessException;
28
29
30
31
32 public class SessionDocumentDaoOjb extends PlatformAwareDaoBaseOjb implements SessionDocumentDao{
33 private static Logger LOG = Logger.getLogger(SessionDocumentDaoOjb.class);
34 private BusinessObjectDao businessObjectDao;
35
36
37 public SessionDocumentDaoOjb() {
38 super();
39 }
40
41
42
43
44
45
46 public void purgeAllSessionDocuments(Timestamp expirationDate)throws DataAccessException {
47 Criteria criteria = new Criteria();
48 criteria.addLessThan(KNSPropertyConstants.LAST_UPDATED_DATE, expirationDate);
49 getPersistenceBrokerTemplate().deleteByQuery(QueryFactory.newQuery(SessionDocument.class, criteria));
50
51
52 }
53
54
55 }