You might end up with this exception while doing your one to one ,or many to one relationship in hibernate.
To fix correct this exception Check following :
1. Your one to one mapping bean is pointing to correct column.
2. You have configured both table correctly.
Once you have correct these your exception will go away.
Exception:
Exception in thread "main" java.lang.NullPointerException at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1127) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283) at com.javatpoint.Test.main(Test.java:13)
To fix correct this exception Check following :
1. Your one to one mapping bean is pointing to correct column.
2. You have configured both table correctly.
Once you have correct these your exception will go away.
Comments
Post a Comment