Is it possible to have two mapping files using the same POJO
bcoz im getting the error duplicate class mapping. Im referring to the same java Object in two mapping files
Code:
log4j:WARN No appenders could be found for logger (com.tcs.pdn.dataservices.order.Impl.reviewImpl).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
at com.tcs.pdn.dataservices.common.HibernateUtil.<clinit>(HibernateUtil.java:24)
at com.tcs.pdn.dataservices.order.dao.ORDOrderDAO.getSessionFactory(ORDOrderDAO.java:52)
at com.tcs.pdn.dataservices.order.dao.ORDOrderDAO.<init>(ORDOrderDAO.java:47)
at com.tcs.pdn.dataservices.order.Impl.TestImpl.saveOrder(TestImpl.java:64)
at com.tcs.pdn.dataservices.order.Impl.TestImpl.main(TestImpl.java:596)
Caused by: org.hibernate.MappingException: Could not read mappings from resource: com/tcs/pdn/dataservices/order/mapping/PpaPortfolioPositions.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:476)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1414)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1382)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1363)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1339)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1259)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1245)
at com.tcs.pdn.dataservices.common.HibernateUtil.<clinit>(HibernateUtil.java:18)
... 4 more
Caused by: org.hibernate.MappingException: duplicate class mapping: com.tcs.pdn.to.order.PPAPortfolioPositionTO
at org.hibernate.cfg.Mappings.addClass(Mappings.java:96)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:111)
at org.hibernate.cfg.Configuration.add(Configuration.java:379)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:418)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:473)
... 11 more