Injector injector = Guice.createInjector(new HibernateModule());
AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();
new SchemaExport(cfg).drop(false, true);
new SchemaExport(cfg).create(false, true);
Managers managers = injector.getInstance(Managers.class);
User user = new User();
user.setName("joe smith");
managers.forClass(User.class).save(user);
Manager<Poll> manager = managers.forClass(Poll.class);
Poll poll1 = new Poll();
poll1.setPubDate(new Date());
poll1.setUser(user);
manager.save(poll1);
Manager<Choice> choiceManager = managers.forClass(Choice.class);
Choice choice1 = new Choice();
choice1.setPoll(poll1);
choice1.setChoice("My cool choice");
choiceManager.save(choice1);