package com.palmnest.dao.repair.impl;

import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.repair.RepairBillMaterialDao;
import com.palmnest.model.repair.RepairBillMaterial;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("repairBillMaterialDao")
public class RepairBillMaterialDaoImpl extends GenericDaoHibernate<RepairBillMaterial, Long> implements RepairBillMaterialDao {

	public RepairBillMaterialDaoImpl() {
		super(RepairBillMaterial.class);
	}

	@Override
	public List<RepairBillMaterial> findBy(Long billId) {
		String strHql = "from RepairBillMaterial where billId = ?";
		return getSession().createQuery(strHql).setLong(0, billId).list();
	}

}
