All pastes #229522 Raw Edit

Anonymous

public text v1 · immutable
#229522 ·published 2006-10-30 19:21 UTC
rendered paste body

NodeDaoHibernate:

    public Collection<OnmsNode> findByCategory(OnmsCategory category) {
        return find("select distinct n from OnmsNode as n "
                    + "join n.categories c "
                    + "left join fetch n.assetRecord "
                    + "left join fetch n.ipInterfaces as iface "
                    + "left join fetch iface.monitoredServices as monSvc "
                    + "left join fetch monSvc.serviceType "
                    + "left join fetch monSvc.currentOutages "
                    + "where c.name = ?",
                    category.getName());
    }

MonitoriedServiceDaoHibernate:

    public Collection<OnmsMonitoredService> findByApplication(OnmsApplication application) {
        return find("select distinct svc from OnmsMonitoredService as svc "
                    + "join svc.applications a "
                    + "where a.name = ?",
                    application.getName());
    }