我对表的查询 修改 删除都没问题, 但是在增加的时候包不支持数据库主键策略我的数据库UserT这表的uid是自动增长的主键。
org.springframework.orm.hibernate3.HibernateSystemException: Dialect does not support identity key generation; nested exception is org.hibernate.MappingException: Dialect does not support identity key generation
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694)
com.entity.daoImp.UserDaoImp.inser(UserDaoImp.java:45)
com.entity.bizImp.UserBizImp.inser(UserBizImp.java:44)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy0.inser(Unknown Source)-------------------------------------------------------
UserT.hbm.xml
 <class name="com.entity.vo.UserT" table="userT" schema="dbo" catalog="testSSH">
        <id name="uid" type="java.lang.Integer">
            <column name="uId" />
            <generator class="identity"></generator>
        </id>--------------------------------------------------------
create table userT(
uId    int identity primary key,
uUame  varchar(20),
uAge   int,
uSex   int
)
go
--------------------------------------------------------
还打印了hibernate的HQL语句:
Hibernate: insert into testSSH.dbo.userT (uUame, uAge, uSex) values (?, ?, ?)数据的uid增长了一位,但是数据好像是回滚了。等高手。