Hi,
I'm new to Hibernate, I'm trying to use Hibernate to save some data into a database table using SunOne app server.
Have done the necessary mappings and (as can be seen from the logs below) Hibernate even picks up the correct mappings. Thereafter on invoking the session.save(applicationPool), it throws up the following exception
net.sf.hibernate.MappingException: No persister for: eg.ApplicationPool
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2656)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2663)
Some place before this trace the mapping is correctly found
cfg.Environment - Hibernate 2.1.2
cfg.Environment - hibernate.properties not found
cfg.Environment - using CGLIB reflection optimizer
cfg.Configuration - configuring from resource: /hibernate.cfg.xml
cfg.Configuration - Configuration resource: /hibernate.cfg.xml
cfg.Configuration - Mapping resource: eg/ApplicationPool.hbm.xml
cfg.Binder - Mapping class: eg.ApplicationPool -> application_pool
cfg.Configuration - Configured SessionFactory: null
cfg.Configuration - processing one-to-many association mappings
cfg.Configuration - processing one-to-one association property references
cfg.Configuration - processing foreign key constraints
dialect.Dialect - Using dialect: net.sf.hibernate.dialect.OracleDialect
cfg.SettingsFactory - Use outer join fetching: true
Code:
session = HibernateSession.currentSession();
ApplicationPool applicationPool = new ApplicationPool();
BeanUtils.copyProperties(applicationPool, userPool);
session.save(applicationPool);
session.flush();
Have been trying to figure this out for some time now.
Has anyone had a problem like this before? Could someone please help.
Thanks in advance.
-Ram.