001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.dao.impl;
017
018import org.kuali.rice.krad.dao.PersistedLookupMetadataDao;
019
020import javax.persistence.EntityManager;
021import javax.persistence.Query;
022import java.sql.Timestamp;
023
024@Deprecated
025public class PersistedLookupMetadataDaoJpa implements PersistedLookupMetadataDao {
026    private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PersistedLookupMetadataDaoJpa.class);
027    
028        private EntityManager entityManager;
029    
030    @Override
031    public void deleteOldLookupResults(Timestamp expirationDate) {
032        Query query = entityManager.createNamedQuery("LookupResults.deleteOldLookupResults");
033        query.setParameter("expirationDate", expirationDate);
034        query.executeUpdate();
035    }
036
037    @Override
038    public void deleteOldSelectedObjectIds(Timestamp expirationDate) {
039        Query query = entityManager.createNamedQuery("SelectedObjectIds.deleteOldSelectedObjectIds");
040        query.setParameter("expirationDate", expirationDate);
041        query.executeUpdate();
042    }
043
044    /**
045     * @return the entityManager
046     */
047    public EntityManager getEntityManager() {
048        return this.entityManager;
049    }
050
051    /**
052     * @param entityManager the entityManager to set
053     */
054    public void setEntityManager(EntityManager entityManager) {
055        this.entityManager = entityManager;
056    }
057}