xml version DOCTYPE hibernate-mapping PUBLIC Hibernate Hibernate Mappi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Dec 15, 2014 10:53:30 PM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="info.inetsolv.Emp" table="EMP" schema="RAHUL" lazy="true">
<id name="eno" type="java.lang.Integer">
<column name="ENO" precision="22" scale="0" />
<generator class="assigned" />
</id>
<property name="name" type="java.lang.String">
<column name="NAME" length="20" />
</property>
<property name="salary" type="java.lang.Double">
<column name="SALARY" precision="10" />
</property>
</class>
</hibernate-mapping>
i'm getting error like
Exception in thread "main" org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
at info.inetsolv.Emp_$$_javassist_0.getName(Emp_$$_javassist_0.java)
at info.inetsolv.MyApp.main(MyApp.java:16)