2011-9-24 16:16:27 org.hibernate.cfg.Environment <clinit>
信息: Hibernate 3.3.2.GA
2011-9-24 16:16:27 org.hibernate.cfg.Environment <clinit>
信息: hibernate.properties not found
2011-9-24 16:16:27 org.hibernate.cfg.Environment buildBytecodeProvider
信息: Bytecode provider name : javassist
2011-9-24 16:16:27 org.hibernate.cfg.Environment <clinit>
信息: using JDK 1.4 java.sql.Timestamp handling
2011-9-24 16:16:27 org.hibernate.cfg.Configuration configure
信息: configuring from resource: /hibernate.cfg.xml
2011-9-24 16:16:27 org.hibernate.cfg.Configuration getConfigurationInputStream
信息: Configuration resource: /hibernate.cfg.xml
2011-9-24 16:16:27 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : com/hibernate/UInfo.hbm.xml
2011-9-24 16:16:27 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.hibernate.Uinfo -> uinfo
2011-9-24 16:16:27 org.hibernate.cfg.Configuration doConfigure
信息: Configured SessionFactory: null
2011-9-24 16:16:27 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: Using Hibernate built-in connection pool (not for production use!)
2011-9-24 16:16:27 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: Hibernate connection pool size: 20
2011-9-24 16:16:27 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: autocommit mode: false
2011-9-24 16:16:27 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: using driver: com.microsoft.sqlserver.jdbc.SQLServerDriver at URL: jdbc:sqlserver://localhost:1433;databaseName=Info
2011-9-24 16:16:27 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: connection properties: {user=sa, password=****}
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: RDBMS: Microsoft SQL Server, version: 10.50.2500
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC driver: Microsoft SQL Server JDBC Driver 3.0, version: 3.0.1301.101
2011-9-24 16:16:27 org.hibernate.dialect.Dialect <init>
信息: Using dialect: org.hibernate.dialect.SQLServerDialect
2011-9-24 16:16:27 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
信息: Using default transaction strategy (direct JDBC transactions)
2011-9-24 16:16:27 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic flush during beforeCompletion(): disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic session close at end of transaction: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Scrollable result sets: enabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC3 getGeneratedKeys(): enabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Connection release mode: auto
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default batch fetch size: 1
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Generate SQL with comments: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL updates by primary key: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL inserts for batching: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2011-9-24 16:16:27 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
信息: Using ASTQueryTranslatorFactory
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query language substitutions: {}
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: JPA-QL strict compliance: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Second-level cache: enabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query cache: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory createRegionFactory
信息: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Optimize cache for minimal puts: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Structured second-level cache entries: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Statistics: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Deleted entity synthetic identifier rollback: disabled
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default entity-mode: pojo
2011-9-24 16:16:27 org.hibernate.cfg.SettingsFactory buildSettings
信息: Named query checking : enabled
2011-9-24 16:16:27 org.hibernate.impl.SessionFactoryImpl <init>
信息: building session factory
2011-9-24 16:16:27 org.hibernate.impl.SessionFactoryObjectFactory addInstance
信息: Not binding factory to JNDI, no JNDI name configured
2011-9-24 16:16:28 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 515, SQLState: 23000
2011-9-24 16:16:28 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: 不能将值 NULL 插入列 'unum',表 'UInfo.dbo.uinfo';列不允许有 Null 值。INSERT 失败。
org.hibernate.exception.ConstraintViolationException: could not insert: [com.hibernate.Uinfo]
//插入代码如下:
public void save(Object obj) {
Session session = HibernateSessionFactory.getSession();
Transaction trans = session.beginTransaction();

try {
session.save(obj);
trans.commit();
} catch (HibernateException e) {
e.printStackTrace();
trans.rollback();
}finally{
session.close();

}
//最终的实现代码如下
package com.test;import com.db_dao.BaseDao;
import com.hibernate.Uinfo;
import com.hibernateDao.UserDao;import junit.framework.TestCase;public class UserDaoTest extends TestCase { UserDao dao;
protected void setUp() throws Exception {
super.setUp();
 dao = new UserDao();
} protected void tearDown() throws Exception {
super.tearDown();
} public void testSave() {

Uinfo u = new Uinfo();

u.setUnum("123");
u.setUname("windson");
u.setUage("23");

System.out.println(u.getUnum()+u.getUname()+u.getUage());


dao.save(u);

} /*public void testDelete() {

} public void testUpdate() {

} public void testList() {

} public void testGet() {

}
*/
}一直说插入数据库的主键字段的值不能为空,但是我插入的值就不是空的,求解
查了些资料,说数据库的标识规范需要进行修改,但是进了sql server 2008发现修改不了
请各位大大帮忙看看