配置SPRING和HIBERNATE的xml文件
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"></property>
  <property name="jdbcUrl" value="jdbc:oracle:thin:@50671d85dd96494.:1521:orcl"></property>
  <property name="user" value="system"></property>
  <property name="password" value="admin"></property>
  <!-- 最大连接数 -->
  <property name="maxPoolSize" value="100"></property>
  <!-- 最小连接数 -->
  <property name="minPoolSize" value="1"></property>
  <!-- 最大空闲时间 -->
  <property name="maxIdleTime" value="3000"></property>
  <!-- 初始化连接数 -->
  <property name="initialPoolSize" value="3"></property>
  <!-- 一次获取连接数 -->
  <property name="acquireIncrement" value="3"></property>
</bean><bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
  <property name="dataSource" ref="dataSource"></property>
  
  <property name="mappingResources">
    <list>
      <value>entity/Customer.hbm.xml</value>
    </list>
  </property>
  <property name="hibernateProperties">
    <props>
      <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
      <prop key="hibernate.show_sql">true</prop>
      
    </props>
  </property>
</bean><!-- 配置hibernateTemplate模板 -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
  <property name="sessionFactory" ref="sessionFactory"></property>
<!--   <property name="allowCreate" value="true"></property>--> 
</bean><!-- 把hibernateTemplate注入到DAO类中 -->
<bean id="customerDao" class="dao.CustomerImplDao">
  <property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
</beans>
调用hibernateTemplate.save()方法,报找不到配置的序列值
Customer.hbm.xml文件配置
<hibernate-mapping>
    <class name="entity.Customer" table="CUSTOMER" schema="SYSTEM">
        <id name="id" type="java.lang.Long">
            <column name="ID" precision="22" scale="0" />
            <generator class="native">
              <param name="sequence">customer_seq</param>
            </generator>
        </id>
        <property name="username" type="java.lang.String">
            <column name="USERNAME" length="30" />
        </property>
        <property name="password" type="java.lang.String">
            <column name="PASSWORD" length="20" />
        </property>
    </class>
</hibernate-mapping>
异常:Hibernate: insert into SYSTEM.CUSTOMER (USERNAME, PASSWORD) values (?, ?)
org.springframework.dao.DataIntegrityViolationException: could not insert: [entity.Customer]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [entity.Customer]
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [entity.Customer]Caused by: java.sql.SQLException: ORA-01400: 无法将 NULL 插入 ("SYSTEM"."CUSTOMER"."ID")