日期:2014-05-18  浏览次数:20756 次

Hibernate 4的问题。。
我用hibernate4+Spring3做测试遇到一个问题:当关系表中无主键是,不能入库处理。有关系表时候能处理。。什么原因。各位大侠麻烦看看:
不能处理日志:
2013-2-22 12:27:36 org.springframework.test.context.TestContextManager retrieveTestExecutionListeners
信息: @TestExecutionListeners is not present for class [class com.uc.common.dao.BaseDBDaoTest]: using defaults.
2013-2-22 12:27:36 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext_test.xml]
2013-2-22 12:27:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext_db.xml]
2013-2-22 12:27:37 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.GenericApplicationContext@12152e6: startup date [Fri Feb 22 12:27:37 CST 2013]; root of context hierarchy
2013-2-22 12:27:37 org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
信息: Loading properties file from class path resource [jdbc.properties]
2013-2-22 12:27:37 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@958bb8: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,testService,commonDao,dataSource,org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,sessionFactory,transactionManager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,txPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
2013-2-22 12:27:37 org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2013-2-22 12:27:37 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
2013-2-22 12:27:37 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
2013-2-22 12:27:37 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
2013-2-22 12:27:38 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2013-2-22 12:27:38 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2013-2-22 12:27:38 org.hibernate.engine.transaction.internal.TransactionFactoryInitiat