1 32 33 package it.businesslogic.ireport.connection; 34 import org.hibernate.SessionFactory; 35 import org.hibernate.cfg.Configuration; 36 import org.hibernate.classic.Session; 37 41 public class JRHibernateConnection extends it.businesslogic.ireport.IReportConnection { 42 43 private String name; 44 45 46 public JRHibernateConnection() { 47 } 48 49 53 public java.sql.Connection getConnection() { 54 return null; 55 } 56 57 public boolean isJDBCConnection() { 58 return false; 59 } 60 61 public boolean isJRDataSource() { 62 return false; 63 } 64 65 68 public java.util.HashMap getProperties() 69 { 70 java.util.HashMap map = new java.util.HashMap (); 71 return map; 72 } 73 74 public void loadProperties(java.util.HashMap map) 75 { 76 } 77 78 public String getDescription(){ return "Hibernate connection"; } 79 80 81 85 public java.lang.String getName() { 86 return name; 87 } 88 89 93 public void setName(java.lang.String name) { 94 this.name = name; 95 } 96 97 101 public net.sf.jasperreports.engine.JRDataSource getJRDataSource() { 102 return null; 103 } 104 105 public Session createSession() throws org.hibernate.HibernateException 106 { 107 return getSessionFactory().openSession(); 108 } 109 110 public SessionFactory getSessionFactory() throws org.hibernate.HibernateException { 111 112 return new Configuration ().configure().buildSessionFactory(); 113 } 114 115 } 116 117 | Popular Tags |