001package org.kuali.ole.service.impl;
002
003import org.apache.ojb.broker.query.Criteria;
004import org.apache.ojb.broker.query.QueryFactory;
005import org.kuali.ole.select.bo.OLEHoldingsRecord;
006import org.kuali.ole.service.OLEHoldingsDao;
007import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
008
009import java.util.Collection;
010import java.util.List;
011
012/**
013 * Created with IntelliJ IDEA.
014 * User: vivekb
015 * Date: 4/11/14
016 * Time: 12:21 PM
017 * To change this template use File | Settings | File Templates.
018 */
019public class OLEHoldingsDaoOjb extends PlatformAwareDaoBaseOjb implements OLEHoldingsDao {
020
021    @Override
022    public List<OLEHoldingsRecord> getHoldingsByCollection(Collection bibIds) {
023        Criteria criteria = new Criteria();
024        criteria.addColumnIn("BIB_ID",bibIds);
025        List<OLEHoldingsRecord> holdingsRecords = (List<OLEHoldingsRecord>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(OLEHoldingsRecord.class, criteria));
026        return holdingsRecords;
027    }
028}