Spring Java模型属性限制为1,000?

时间:2013-12-11 19:25:35

标签: java spring hibernate jdbc

我正在使用Spring / Hibernate,这是我第一次拥有一个具有大约1500个属性的Java模型对象(我在研究中心工作并且有一个数据收集表格就是这么长)而且我是在应用程序启动期间收到以下错误:

INFO 12/11 18:43:16 org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.5.27
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL Connector Java, version: mysql-connector-java-5.1.27 ( Revision: alexander.soklakov@oracle.com-20131021093118-gtm1bh1vb450xipt )
INFO 12/11 18:43:16 org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
INFO 12/11 18:43:16 org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
INFO 12/11 18:43:16 org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Connection release mode: on_close
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO 12/11 18:43:16 org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Query cache: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Statistics: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
INFO 12/11 18:43:16 org.hibernate.cfg.SettingsFactory - Named query checking : enabled
INFO 12/11 18:43:16 org.hibernate.impl.SessionFactoryImpl - building session factory
ERROR 12/11 18:43:18 edu.ucsf.lava.core.dao.hibernate.LavaDaoHibernateImpl - Unable to load bean 'lavaDao' from application contextorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lavaDao' defined in ServletContext resource [/WEB-INF/context/core/core-dao.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/context/local/pedi/pedi-env-tomcat6.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/context/core/core-dao.xml]: Invocation of init method failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null

我知道MySQL InnoDB表有1000列限制,因此我将模型对象拆分为两个表,其中表1包含约960列,表2包含其余表。它似乎是属性数量的问题,因为当我将属性降低到1000以下时,应用程序启动正常,但是当我添加更多属性时,我得到上述错误。由于hibernate对属性数量没有特定的限制,问题可能出在JDBC上吗?是否有一个JDBC属性,我可以设置为允许大量的列?其他地方有问题吗?我也修改了MySQL my.cnf设置无济于事。

感谢您的任何建议/帮助。

0 个答案:

没有答案