Examples of HibernateSessionSource


Examples of org.apache.tapestry.hibernate.HibernateSessionSource

      List<HibernateConfigurer> filters = Arrays.asList(
          new DefaultHibernateConfigurer(),
          new PackageNameHibernateConfigurer(packageManager, new ClassNameLocatorImpl()));
     
      replay();
        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, filters);

        Session session = source.create();
    assertNotNull(session);
   
    // make sure it found the entity in the package
    ClassMetadata meta = session.getSessionFactory().getClassMetadata(User.class);
    assertEquals(meta.getEntityName(), "org.example.app0.entities.User");
View Full Code Here

Examples of org.apache.tapestry.hibernate.HibernateSessionSource

        List<HibernateConfigurer> filters = Arrays.asList(
                new DefaultHibernateConfigurer(),
                new PackageNameHibernateConfigurer(packageManager, new ClassNameLocatorImpl()));

        replay();
        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, filters);

        Session session = source.create();
        assertNotNull(session);

        // make sure it found the entity in the package
        ClassMetadata meta = session.getSessionFactory().getClassMetadata(User.class);
        assertEquals(meta.getEntityName(), "org.example.app0.entities.User");
View Full Code Here

Examples of org.apache.tapestry.hibernate.HibernateSessionSource

            {
                configuration.setProperty("foo", "bar");
                configuration.configure();
            }
        };
        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, Arrays
                .asList(configurer));

        Configuration config = source.getConfiguration();
        assertNotNull(config);
        assertEquals("bar", config.getProperty("foo"));

        // configuration should be immutable
        try
View Full Code Here

Examples of org.apache.tapestry.hibernate.HibernateSessionSource

        List<HibernateConfigurer> filters = Arrays.asList(
                new DefaultHibernateConfigurer(),
                new PackageNameHibernateConfigurer(packageManager, new ClassNameLocatorImpl()));

        replay();
        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, filters);

        Session session = source.create();
        assertNotNull(session);

        // make sure it found the entity in the package
        ClassMetadata meta = session.getSessionFactory().getClassMetadata(User.class);
        assertEquals(meta.getEntityName(), "org.example.app0.entities.User");
View Full Code Here

Examples of org.apache.tapestry.hibernate.HibernateSessionSource

            {
                configuration.setProperty("foo", "bar");
                configuration.configure();
            }
        };
        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, Arrays
                .asList(configurer));

        Configuration config = source.getConfiguration();
        assertNotNull(config);
        assertEquals("bar", config.getProperty("foo"));

        // configuration should be immutable
        try
View Full Code Here

Examples of org.apache.tapestry.hibernate.HibernateSessionSource

    {
        Collection<String> packageNames = CollectionFactory.newList(
                "org.example.myapp.entities",
                "org.example.app0.entities");

        HibernateSessionSource source = new HibernateSessionSourceImpl(_log, packageNames,
                new ClassNameLocatorImpl());

        assertNotNull(source.create());
    }
View Full Code Here

Examples of org.apache.tapestry5.hibernate.HibernateSessionSource

                new DefaultHibernateConfigurer(),
                new PackageNameHibernateConfigurer(packageManager,
                                                   new ClassNameLocatorImpl(new ClasspathURLConverterImpl())));

        replay();
        HibernateSessionSource source = new HibernateSessionSourceImpl(log, filters);

        Session session = source.create();
        assertNotNull(session);

        // make sure it found the entity in the package
        ClassMetadata meta = session.getSessionFactory().getClassMetadata(User.class);
        assertEquals(meta.getEntityName(), "org.example.app0.entities.User");
View Full Code Here

Examples of org.apache.tapestry5.hibernate.HibernateSessionSource

            {
                configuration.setProperty("foo", "bar");
                configuration.configure();
            }
        };
        HibernateSessionSource source = new HibernateSessionSourceImpl(log, Arrays
                .asList(configurer));

        Configuration config = source.getConfiguration();
        assertNotNull(config);
        assertEquals("bar", config.getProperty("foo"));

        // configuration should be immutable
        try
View Full Code Here

Examples of org.apache.tapestry5.hibernate.HibernateSessionSource

                new PackageNameHibernateConfigurer(packageManager, classNameLocator));


        replay();

        HibernateSessionSource source = new HibernateSessionSourceImpl(log, filters);

        Session session = source.create();
        Assert.assertNotNull(session);

        // make sure it found the entity in the package
        ClassMetadata meta = session.getSessionFactory().getClassMetadata(User.class);
        Assert.assertEquals(meta.getEntityName(), "org.example.app0.entities.User");
View Full Code Here

Examples of org.apache.tapestry5.hibernate.HibernateSessionSource

            {
                configuration.setProperty("foo", "bar");
                configuration.configure();
            }
        };
        HibernateSessionSource source = new HibernateSessionSourceImpl(log, Arrays.asList(configurer));

        Configuration config = source.getConfiguration();
        Assert.assertNotNull(config);
        Assert.assertEquals("bar", config.getProperty("foo"));

        // Configuration was immutable in 5.1, but Hibernate 3.6.0.Final made that impossible
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.