// Path: chapter09/src/main/java/com/packtpub/pf/blueprint/persistence/HibernateUtil.java
// public class HibernateUtil {
// 
//     private static final SessionFactory sessionFactory = buildSessionFactory();
// 
//     private static SessionFactory buildSessionFactory() throws HibernateException {
//         Configuration configuration = new Configuration().configure();
//         // configures settings from hibernate.cfg.xml
// 
//         StandardServiceRegistryBuilder serviceRegistryBuilder = new StandardServiceRegistryBuilder();
// 
//         // If you miss the below line then it will complain about a missing dialect setting
//         serviceRegistryBuilder.applySettings(configuration.getProperties());
// 
//         ServiceRegistry serviceRegistry = serviceRegistryBuilder.build();
//         return configuration.buildSessionFactory(serviceRegistry);
//     }
// 
//     public static SessionFactory getSessionFactory() {
//         return sessionFactory;
//     }
// 
//     public static void shutdown() {
//         // Close caches and connection pools
//         getSessionFactory().close();
//     }
// 
// }
// 
// Path: chapter07/src/main/java/com/packtpub/pf/blueprint/persistence/entity/Location.java
// @Data
// @Entity
// @Table
// public class Location implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @Id
//     @GeneratedValue(strategy= GenerationType.AUTO)
//     private int id;
//     @NaturalId
//     @Basic(optional = false)
//     @Column(name = "franchisee_no")
//     Long franchiseeNo;
//     @Basic(optional = false)
//     double longitude;
//     @Basic(optional = false)
//     double latitude;
//     @Basic(optional = false)
//     String street1;
//     @Basic(optional = false)
//     String city;
//     String state;
//     @Basic(optional = false)
//     String zipcode;
//     String country;
// }


import com.packtpub.pf.blueprint.persistence.HibernateUtil;
import com.packtpub.pf.blueprint.persistence.entity.Location;
import org.hibernate.Session;
import java.util.List;
package com.pocketpub.pfbp.test;



/**
 * Created with IntelliJ IDEA.
 * User: psramkumar
 * Date: 2/6/14
 * Time: 7:44 PM
 * To change this template use File | Settings | File Templates.
 */
public class HibernateUtilTest {

    public static void main(String[] args) {
        System.out.println("Testing Hibernate Utility Class");
// Path: chapter09/src/main/java/com/packtpub/pf/blueprint/persistence/HibernateUtil.java
// public class HibernateUtil {
// 
//     private static final SessionFactory sessionFactory = buildSessionFactory();
// 
//     private static SessionFactory buildSessionFactory() throws HibernateException {
//         Configuration configuration = new Configuration().configure();
//         // configures settings from hibernate.cfg.xml
// 
//         StandardServiceRegistryBuilder serviceRegistryBuilder = new StandardServiceRegistryBuilder();
// 
//         // If you miss the below line then it will complain about a missing dialect setting
//         serviceRegistryBuilder.applySettings(configuration.getProperties());
// 
//         ServiceRegistry serviceRegistry = serviceRegistryBuilder.build();
//         return configuration.buildSessionFactory(serviceRegistry);
//     }
// 
//     public static SessionFactory getSessionFactory() {
//         return sessionFactory;
//     }
// 
//     public static void shutdown() {
//         // Close caches and connection pools
//         getSessionFactory().close();
//     }
// 
// }
// 
// Path: chapter07/src/main/java/com/packtpub/pf/blueprint/persistence/entity/Location.java
// @Data
// @Entity
// @Table
// public class Location implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @Id
//     @GeneratedValue(strategy= GenerationType.AUTO)
//     private int id;
//     @NaturalId
//     @Basic(optional = false)
//     @Column(name = "franchisee_no")
//     Long franchiseeNo;
//     @Basic(optional = false)
//     double longitude;
//     @Basic(optional = false)
//     double latitude;
//     @Basic(optional = false)
//     String street1;
//     @Basic(optional = false)
//     String city;
//     String state;
//     @Basic(optional = false)
//     String zipcode;
//     String country;
// }


// Path: chapter08/src/test/java/com/pocketpub/pfbp/test/HibernateUtilTest.java
import com.packtpub.pf.blueprint.persistence.HibernateUtil;
import com.packtpub.pf.blueprint.persistence.entity.Location;
import org.hibernate.Session;
import java.util.List;

package com.pocketpub.pfbp.test;



/**
 * Created with IntelliJ IDEA.
 * User: psramkumar
 * Date: 2/6/14
 * Time: 7:44 PM
 * To change this template use File | Settings | File Templates.
 */
public class HibernateUtilTest {

    public static void main(String[] args) {
        System.out.println("Testing Hibernate Utility Class");
        Session session = HibernateUtil.getSessionFactory().openSession();