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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations