Hi all,
I am new to Hibernate. I am entangled with Collection-Mappping.
I need some good tutorial having complete example program on Collection Mapping. Also, i tried the following to
test Collection mapping.
I wrote the following POJO class:
I wrote the following class to persist an object of type Book into the MYSQL database running on local host:
The following is the content of my mapping file:
When run the second program, i am getting the following output:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
null
Exception in
thread "main" java.lang.NullPointerException
at roseindia.tutorial.hibernatecollection.BookInsert.main(BookInsert.java:52)
The line where the NullPointerException took place corresponds to:
session.flush(); Kindly let me know where i could have gone wrong.