private static final String OUTPUT_FILE = "random_events.txt";
private static final int NUM_EVENTS = 100;
private static final SessionStrategy sessionStrategy = HibernateSessionStrategy.getInstance();
public static void main(String[] args) {
Query q = new BasicQuery();
List<Event> events;
try {
sessionStrategy.beginTransaction();
events = q.getRandom(NUM_EVENTS);
sessionStrategy.commitTransaction();
} finally {
sessionStrategy.rollbackIfActive();
}