Search in sources :

Example 56 with HibSession

use of org.bedework.calcorei.HibSession in project bw-calendar-engine by Bedework.

the class CoreEventsDAO method getEventOverrides.

@SuppressWarnings("unchecked")
public Collection<BwEventAnnotation> getEventOverrides(final BwEvent ev) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getEventOverridesQuery);
    sess.setEntity("target", ev);
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 57 with HibSession

use of org.bedework.calcorei.HibSession in project bw-calendar-engine by Bedework.

the class CoreEventsDAO method getInstance.

protected BwRecurrenceInstance getInstance(final BwEvent ev, final String rid) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(recurrenceInstanceQuery);
    sess.setEntity("master", ev);
    sess.setString("rid", rid);
    return (BwRecurrenceInstance) sess.getUnique();
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwRecurrenceInstance(org.bedework.calfacade.BwRecurrenceInstance)

Example 58 with HibSession

use of org.bedework.calcorei.HibSession in project bw-calendar-engine by Bedework.

the class CoreEventsDAO method getChildrenEntities.

public List getChildrenEntities(final String parentPath, final int start, final int count) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getChildEntitiesQuery);
    sess.setString("colPath", parentPath);
    sess.setFirstResult(start);
    sess.setMaxResults(count);
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 59 with HibSession

use of org.bedework.calcorei.HibSession in project bw-calendar-engine by Bedework.

the class EntityDAO method get.

public BwCalSuite get(final BwAdminGroup group) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getCalSuiteByGroupQuery);
    sess.setEntity("group", group);
    sess.cacheableQuery();
    final BwCalSuite cs = (BwCalSuite) sess.getUnique();
    if (cs != null) {
        sess.evict(cs);
    }
    return cs;
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwCalSuite(org.bedework.calfacade.svc.BwCalSuite)

Example 60 with HibSession

use of org.bedework.calcorei.HibSession in project bw-calendar-engine by Bedework.

the class EntityDAO method getUnexpiredAlarms.

@SuppressWarnings("unchecked")
public Collection<BwAlarm> getUnexpiredAlarms(final long triggerTime) throws CalFacadeException {
    final HibSession sess = getSess();
    if (triggerTime == 0) {
        sess.createQuery(getUnexpiredAlarmsQuery);
    } else {
        sess.createQuery(getUnexpiredAlarmsTimeQuery);
        sess.setString("tt", String.valueOf(triggerTime));
    }
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Aggregations

HibSession (org.bedework.calcorei.HibSession)60 Collection (java.util.Collection)4 BwCalendar (org.bedework.calfacade.BwCalendar)4 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)4 BwGroup (org.bedework.calfacade.BwGroup)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 TreeSet (java.util.TreeSet)2 BwEvent (org.bedework.calfacade.BwEvent)2 BwEventAnnotation (org.bedework.calfacade.BwEventAnnotation)2 BwEventProperty (org.bedework.calfacade.BwEventProperty)2 BwEventProxy (org.bedework.calfacade.BwEventProxy)2 BwPrincipal (org.bedework.calfacade.BwPrincipal)2 BwCalSuite (org.bedework.calfacade.svc.BwCalSuite)2 BwCategory (org.bedework.calfacade.BwCategory)1 BwContact (org.bedework.calfacade.BwContact)1 BwDateTime (org.bedework.calfacade.BwDateTime)1 BwFilterDef (org.bedework.calfacade.BwFilterDef)1 BwLocation (org.bedework.calfacade.BwLocation)1 BwRecurrenceInstance (org.bedework.calfacade.BwRecurrenceInstance)1