Package javango.db

Examples of javango.db.Managers


      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);     
     
      Manager<Poll> manager = managers.forClass(Poll.class);     
      assertEquals(HibernateManager.class, manager.getClass());
     
      Poll poll = new Poll();
      poll.setPubDate(new Date());
     
View Full Code Here


      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);     
     
      Manager<Poll> manager = managers.forClass(Poll.class);     
      assertEquals(HibernateManager.class, manager.getClass());
     
      Poll poll = new Poll();
      poll.setPubDate(new Date());
      manager.save(poll);
View Full Code Here

      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);     
     
      Manager<Poll> manager = managers.forClass(Poll.class);     
     
      Poll poll = new Poll();
      poll.setQuestion("What is this");
      poll.setPubDate(new Date());
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choiceManager.save(choice);
     
View Full Code Here

    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);     
     
      Manager<Poll> manager = managers.forClass(Poll.class);     
     
      Poll poll = new Poll();
      poll.setPubDate(new Date());
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choice.setVotes(1L); // should match the id for the property test below...
      choiceManager.save(choice);
View Full Code Here

      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);     
     
      Manager<Poll> manager = managers.forClass(Poll.class);     
     
      Poll poll = new Poll();
      poll.setPubDate(new Date());
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choiceManager.save(choice);
     
View Full Code Here

      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 poll = new Poll();
      poll.setPubDate(new Date());
      poll.setUser(user);
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choiceManager.save(choice);
     
View Full Code Here

      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 poll = new Poll();
      poll.setPubDate(new Date());
      poll.setUser(user);
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choiceManager.save(choice);
     
View Full Code Here

      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 poll = new Poll();
      poll.setPubDate(new Date());
      poll.setUser(user);
      manager.save(poll);
     
      Manager<Choice> choiceManager = managers.forClass(Choice.class);
      Choice choice = new Choice();
      choice.setPoll(poll);
      choice.setChoice("My cool choice");
      choiceManager.save(choice);
     
View Full Code Here

    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);
     
View Full Code Here

  public static class MyOtherModel {
  }
 
  public void testCustomManager() throws Exception {
    Injector injector = Guice.createInjector(new HibernateModule());
    Managers managers = injector.getInstance(Managers.class);
    Manager<? extends MyModel> manager = managers.forClass(MyModel.class);
    assertEquals(manager.getClass(), MyManager.class);
  }
View Full Code Here

TOP

Related Classes of javango.db.Managers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.