Package cirrus.hibernate

Examples of cirrus.hibernate.Datastore


        __logger.info( "Initializing" );

        try
        {
            Datastore ds = Hibernate.createDatastore(  );

            /* Classes */
            load( Account.class, ds );
            load( Category.class, ds );
            load( Customer.class, ds );
            load( Item.class, ds );
            load( Order.class, ds );
            load( OrderItem.class, ds );
            load( Product.class, ds );

            /* Hibernate properties */
            __logger.info( "...loading: hibernate.properties" );

            InputStream in = getClass(  ).getClassLoader(  ).getResourceAsStream( "hibernate.properties" );
            Properties  props = new Properties(  );
            props.load( in );

            /* Session Factory */
            __logger.info( "...initializing the Hibernate SessionFactory" );

            SessionFactory sessionFactory = ds.buildSessionFactory( props );
            config.getServletContext(  ).setAttribute( SESSION_FACTORY_KEY, sessionFactory );

            __logger.info( "Initialized" );
        }
        catch ( HibernateException h )
View Full Code Here

TOP

Related Classes of cirrus.hibernate.Datastore

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.