2012-8-8 17:31:23 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1b26af3: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1b26af3]; startup date [Wed Aug 08 17:31:23 CST 2012]; root of context hierarchy
2012-8-8 17:31:23 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext.xml]
2012-8-8 17:31:23 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@1b26af3]: org.springframework.beans.factory.support.DefaultListableBeanFactory@198cb3d
2012-8-8 17:31:23 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@198cb3d: defining beans [sessionFactory,EmployeeDaoImpl]; root of factory hierarchy
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2012-8-8 17:31:23 org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
信息: Building new Hibernate SessionFactory
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: ids for this class must be manually assigned before calling save(): Employee.Employee; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): Employee.Employee
Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): Employee.Employee
at org.hibernate.id.Assigned.generate(Assigned.java:53)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:635)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:632)
at Employee.EmployeeDaoImpl.add(EmployeeDaoImpl.java:24)
at Employee.EmployeeDaoImpl.main(EmployeeDaoImpl.java:29)
下面是我的applicationContext.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="sessionFactory"  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   <property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
 </bean>
<bean id="EmployeeDaoImpl" class="Employee.EmployeeDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
</beans>hibernate配置
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration> <session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/myuser
</property>
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">Mysql</property>
<mapping resource="Employee/Employee.hbm.xml" /> </session-factory></hibernate-configuration>
以下是我测试的代码
package Employee;import java.util.Date;自己在自学spring时候整合hibernate时出现以下错误,自己快疯了,请大神帮我看下
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;public class EmployeeDaoImpl extends HibernateDaoSupport{
private HibernateTemplate h;

public HibernateTemplate getH() {
return h;
}
public void setH(HibernateTemplate h) {
this.h = h;
}
public void add(){
Employee e  = new Employee();
e.setName("123");
e.setPassword("123");
e.setBirthday(new Date());
this.getHibernateTemplate().save(e);
}
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
EmployeeDaoImpl em = (EmployeeDaoImpl) context.getBean("EmployeeDaoImpl");
em.add();
}}
请大家帮我看下 是哪里出问题了