01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tcspring.beans.orm.hibernate;
05:
06: import java.util.List;
07:
08: import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
09:
10: import com.tcspring.beans.orm.data.CustomerDao;
11: import com.tcspring.beans.orm.domain.Customer;
12:
13: public class HibernateCustomerDao extends HibernateDaoSupport implements
14: CustomerDao {
15:
16: public List getAll() {
17: return getHibernateTemplate().find("from Customer");
18: }
19:
20: public void save(Customer customer) {
21: getHibernateTemplate().saveOrUpdate(customer);
22: }
23:
24: public List getAllWithOnlyOnePermission() {
25: return getHibernateTemplate().find(
26: "from Customer as c where c.permissions.size = ?",
27: new Object[] { new Integer(1) });
28: }
29: }
|