bunti/src/main/java/de/ctdo/bunti/dao/BuntiDevicesDAOImpl.java

37 lines
903 B
Java
Raw Normal View History

2012-03-02 21:09:43 +00:00
package de.ctdo.bunti.dao;
import java.util.List;
import de.ctdo.bunti.model.*;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
2012-03-02 21:09:43 +00:00
public final class BuntiDevicesDAOImpl extends HibernateDaoSupport implements BuntiDevicesDAO {
2012-03-02 21:09:43 +00:00
@Override
public List<BuntiDMXDevice> getAllDMXDevices() {
return getHibernateTemplate().loadAll(BuntiDMXDevice.class);
2012-03-02 21:09:43 +00:00
}
2012-03-06 23:42:30 +00:00
@Override
public List<BuntiDevice> getAllDevices() {
return getHibernateTemplate().loadAll(BuntiDevice.class);
2012-03-06 23:42:30 +00:00
}
@Override
2012-03-08 00:22:31 +00:00
public BuntiDevice getDeviceById(int deviceId) {
return getHibernateTemplate().get(BuntiDevice.class,deviceId);
}
2012-03-02 21:09:43 +00:00
@Override
public void addDevice(BuntiDevice device) {
getHibernateTemplate().save(device);
}
@Override
public void removeDevice(int deviceId) {
getHibernateTemplate().delete(getDeviceById(deviceId));
}
2012-03-02 21:09:43 +00:00
}