Search in sources :

Example 11 with HibSession

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

the class CoreEventPropertiesDAO method getRefs.

@SuppressWarnings("unchecked")
private List<EventPropertiesReference> getRefs(final BwEventProperty val, final String query) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(query);
    sess.setEntity("ent", val);
    /* May get multiple counts back for events and annotations. */
    final List<EventPropertiesReference> refs = sess.getList();
    if (debug) {
        debug(" ----------- count = " + refs.size());
    }
    return refs;
}
Also used : HibSession(org.bedework.calcorei.HibSession) EventPropertiesReference(org.bedework.calfacade.EventPropertiesReference)

Example 12 with HibSession

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

the class CoreEventsDAO method deleteInstances.

protected void deleteInstances(final BwEvent ev) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(deleteInstancesQuery);
    sess.setEntity("master", ev);
    sess.executeUpdate();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 13 with HibSession

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

the class CoreEventsDAO method getInstances.

protected List getInstances(final BwEvent ev) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(instancesQuery);
    sess.setEntity("master", ev);
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 14 with HibSession

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

the class CoreEventsDAO method getEventsByName.

protected List getEventsByName(final String colPath, final String name) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(eventsByNameQuery);
    sess.setString("name", name);
    sess.setString("colPath", colPath);
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 15 with HibSession

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

the class CoreEventsDAO method getEventsAnnotationName.

protected BwEventAnnotation getEventsAnnotationName(final String colPath, final String name) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(eventAnnotationsByNameQuery);
    sess.setString("name", name);
    sess.setString("colPath", colPath);
    return (BwEventAnnotation) sess.getUnique();
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwEventAnnotation(org.bedework.calfacade.BwEventAnnotation)

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