1 package org.wcb.model.dao.impl; 2 3 import org.wcb.exception.InfrastructureException; 4 import org.wcb.exception.DAOException; 5 import org.wcb.model.vo.hibernate.FAA8710ApplicationBO; 6 import org.wcb.model.dao.IApplicantDAO; 7 8 /** 9 * <small> 10 * Copyright (c) 2006 wbogaardt. 11 * Permission is granted to copy, distribute and/or modify this document 12 * under the terms of the GNU Free Documentation License, Version 1.2 13 * or any later version published by the Free Software Foundation; 14 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 15 * Texts. A copy of the license is included in the section entitled "GNU 16 * Free Documentation License". 17 * <p/> 18 * $File: $ <br> 19 * $Change: $ submitted by $Author: wbogaardt $ at $DateTime: Mar 24, 2006 10:26:59 AM $ <br> 20 * </small> 21 * 22 * @author wbogaardt 23 * @version 1 24 * Date: June 11, 2007 25 * Time: 10:26:59 AM 26 */ 27 public class ApplicantDAO extends AbstractHibernateDAO implements IApplicantDAO { 28 29 /** 30 * Find a log book entry by the primary key id of the entry. 31 * @param id Primary key id in the database 32 * @return The applicant entry 33 * @throws org.wcb.exception.InfrastructureException 34 */ 35 public FAA8710ApplicationBO findEntry(Integer id) throws InfrastructureException { 36 try { 37 return (FAA8710ApplicationBO) getObjectsBy(FAA8710ApplicationBO.class, "id", id).get(0); 38 } catch (DAOException daoe) { 39 throw new InfrastructureException(daoe); 40 } catch (IndexOutOfBoundsException ioobe) { 41 throw new InfrastructureException("No entry found"); 42 } 43 } 44 }