Search in sources :

Example 21 with HibSession

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

the class EntityDAO method getSyspars.

public BwSystem getSyspars(final String name) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getSystemParsQuery);
    sess.setString("name", name);
    return (BwSystem) sess.getUnique();
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwSystem(org.bedework.calfacade.BwSystem)

Example 22 with HibSession

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

the class EntityDAO method getResource.

public BwResource getResource(final String name, final BwCalendar coll, final int desiredAccess) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getResourceQuery);
    sess.setString("name", name);
    sess.setString("path", coll.getPath());
    sess.setString("tsenc", BwResource.tombstoned);
    sess.cacheableQuery();
    return (BwResource) sess.getUnique();
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwResource(org.bedework.calfacade.BwResource)

Example 23 with HibSession

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

the class EntityDAO method getAllResources.

@SuppressWarnings("unchecked")
public List<BwResource> getAllResources(final String path, final boolean forSynch, final String token) throws CalFacadeException {
    final HibSession sess = getSess();
    if (forSynch && (token != null)) {
        sess.createQuery(getAllResourcesSynchQuery);
    } else {
        sess.createQuery(getAllResourcesQuery);
    }
    sess.setString("path", path);
    if (forSynch && (token != null)) {
        sess.setString("lastmod", token.substring(0, 16));
        sess.setInt("seq", Integer.parseInt(token.substring(17), 16));
    } else {
        sess.setString("tsenc", BwResource.tombstoned);
    }
    sess.cacheableQuery();
    return sess.getList();
}
Also used : HibSession(org.bedework.calcorei.HibSession)

Example 24 with HibSession

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

the class EntityDAO method getCalSuite.

public BwCalSuite getCalSuite(final String name) throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getCalSuiteQuery);
    sess.setString("name", name);
    sess.cacheableQuery();
    return (BwCalSuite) sess.getUnique();
}
Also used : HibSession(org.bedework.calcorei.HibSession) BwCalSuite(org.bedework.calfacade.svc.BwCalSuite)

Example 25 with HibSession

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

the class EntityDAO method getAllCalSuites.

@SuppressWarnings("unchecked")
public Collection<BwCalSuite> getAllCalSuites() throws CalFacadeException {
    final HibSession sess = getSess();
    sess.createQuery(getAllCalSuitesQuery);
    sess.cacheableQuery();
    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