// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package test;

import java.util.List;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;

public class T1DAOTraditional {
    private SessionFactory sf;
    public T1 findOne(int f1) throws HibernateException {
        Session s = sf.openSession();
        T1 res = (T1)s.load(T1.class, new Integer(f1));
        s.close();
        return res;
    }
    public List findAll() throws HibernateException {
        Session s = sf.openSession();
        List res = s.find("FROM T1 AS t1");
        s.close();
        return res;
    }
    public SessionFactory getSf() {
        return sf;
    }
    public void setSf(SessionFactory sf) {
        this.sf = sf;
    }
}
