hibernate中的log4j配置以及相关配置说明

 hibernate3 自带的默认的日志框架是slf4j,hibernate3的slf只是一个日志的接口,而hibernate3 自带默认的日志框架,在实际开发中很少有公司或者是项目中用到,这里记录一种使用log4j的日志框架来代替slf4j日志框架的实现,具体配置以及实现如下:

一.加入log4j的日志框架

ZLQ$2@A~@F`5$_EX~K)Z`9N

说明:1.    slf4j-api-1.6.1.jar文件,就是前面指的hibernate3自带日志的API(提供了各种日志的接口).

2.    log4j-1.2.16.jar文件,就是log4j的框架.

3.    slf4j-log4j12-1.6.1.jar文件,就是hibernate3自带的日志接口与log4j中间进行转换的适配器。

 

二、添加log4j的配置文件log4j.properties,到类路径下,并且设置日志的级别。

log4j.properties配置项说明:

org.hibernate.SQL 
在所有SQL DML语句被执行时为它们记录日志

org.hibernate.type 
为所有JDBC参数记录日志

org.hibernate.tool.hbm2ddl 
在所有SQL DDL语句执行时为它们记录日志

org.hibernate.pretty 
在session清洗(flush)时,为所有与其关联的实体(最多20个)的状态记录日志

org.hibernate.cache 
为所有二级缓存的活动记录日志

org.hibernate.transaction 
为事务相关的活动记录日志

org.hibernate.jdbc 
为所有JDBC资源的获取记录日志

org.hibernate.hql.AST 
在解析查询的时候,记录HQL和SQL的AST分析日志

org.hibernate.secure 
为JAAS认证请求做日志

org.hibernate 
为任何Hibernate相关信息做日志 (信息量较大, 但对查错非常有帮助)

 

注意:在以上各种日志类型的配置前面要加上”log4j.logger.”,例如:log4j.logger.org.hibernate.hql=debug

 

三、这时候可以通过日志调试了


如配置org.hibernate会将所有的ora.hibernate下的包下所有的类配置上,这样hibernate的所有类都可以调试了,在hibernate3以前用的是common-logging组件,hibernate3.x后用的是slf4j组件了。下面有相关日志信息:

00:12:45,858  INFO Version:37 - Hibernate Commons Annotations 3.2.0.Final
00:12:45,872  INFO Environment:593 - Hibernate 3.6.0.Final
00:12:45,874  INFO Environment:626 - hibernate.properties not found
00:12:45,882  INFO Environment:804 - Bytecode provider name : javassist
00:12:45,888  INFO Environment:685 - using JDK 1.4 java.sql.Timestamp handling
00:12:45,971 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [uuid2] -> [class org.hibernate.id.UUIDGenerator]
00:12:45,972 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [guid] -> [class org.hibernate.id.GUIDGenerator]
00:12:45,974 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [uuid] -> [class org.hibernate.id.UUIDHexGenerator]
00:12:45,974 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [uuid.hex] -> [class org.hibernate.id.UUIDHexGenerator]
00:12:45,977 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [hilo] -> [class org.hibernate.id.TableHiLoGenerator]
00:12:45,978 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [assigned] -> [class org.hibernate.id.Assigned]
00:12:45,980 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [identity] -> [class org.hibernate.id.IdentityGenerator]
00:12:45,981 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [select] -> [class org.hibernate.id.SelectGenerator]
00:12:45,982 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [sequence] -> [class org.hibernate.id.SequenceGenerator]
00:12:45,983 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [seqhilo] -> [class org.hibernate.id.SequenceHiLoGenerator]
00:12:45,984 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [increment] -> [class org.hibernate.id.IncrementGenerator]
00:12:45,988 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [foreign] -> [class org.hibernate.id.ForeignGenerator]
00:12:45,989 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [sequence-identity] -> [class org.hibernate.id.SequenceIdentityGenerator]
00:12:45,991 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [enhanced-sequence] -> [class org.hibernate.id.enhanced.SequenceStyleGenerator]
00:12:45,992 DEBUG DefaultIdentifierGeneratorFactory:100 - Registering IdentifierGenerator strategy [enhanced-table] -> [class org.hibernate.id.enhanced.TableGenerator]
00:12:45,995  INFO Configuration:2126 - configuring from resource: /hibernate.cfg.xml
00:12:45,995  INFO Configuration:2145 - Configuration resource: /hibernate.cfg.xml
00:12:46,070 DEBUG DTDEntityResolver:67 - trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd]
00:12:46,071 DEBUG DTDEntityResolver:69 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
00:12:46,073 DEBUG DTDEntityResolver:109 - located [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd] in classpath
00:12:46,107 DEBUG Configuration:2088 - connection.driver_class=oracle.jdbc.driver.OracleDriver
00:12:46,108 DEBUG Configuration:2088 - connection.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
00:12:46,108 DEBUG Configuration:2088 - connection.username=hibernate
00:12:46,108 DEBUG Configuration:2088 - connection.password=aaa519760
00:12:46,108 DEBUG Configuration:2088 - hibernate.c3p0.max_size=20
00:12:46,108 DEBUG Configuration:2088 - hibernate.c3p0.min_size=1
00:12:46,108 DEBUG Configuration:2088 - hibernate.c3p0.timeout=5000
00:12:46,109 DEBUG Configuration:2088 - hibernate.c3p0.max_statements=100
00:12:46,109 DEBUG Configuration:2088 - hibernate.c3p0.idle_test_period=3000
00:12:46,109 DEBUG Configuration:2088 - hibernate.c3p0.acquire_increment=2
00:12:46,109 DEBUG Configuration:2088 - dialect=org.hibernate.dialect.Oracle10gDialect
00:12:46,109 DEBUG Configuration:2088 - show_sql=true
00:12:46,109 DEBUG Configuration:2088 - hbm2ddl.auto=create
00:12:46,110 DEBUG Configuration:2313 - session-factory config [null] named resource [com/zjlolife/hibernate/domain/User.hbm.xml] for mapping
00:12:46,110  INFO Configuration:759 - Reading mappings from resource : com/zjlolife/hibernate/domain/User.hbm.xml
00:12:46,147 DEBUG DTDEntityResolver:67 - trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
00:12:46,148 DEBUG DTDEntityResolver:69 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
00:12:46,149 DEBUG DTDEntityResolver:109 - located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
00:12:46,215  INFO Configuration:2267 - Configured SessionFactory: null
00:12:46,215 DEBUG Configuration:2268 - properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl, sun.management.compiler=HotSpot 64-Bit Server Compiler, hbm2ddl.auto=create, os.name=Windows Vista, sun.boot.class.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\resources.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\rt.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\sunrsasign.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jsse.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jce.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\charsets.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\classes, sun.desktop=windows, hibernate.c3p0.max_size=20, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_13-b03, hibernate.c3p0.min_size=1, user.name=zjlolife, connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.c3p0.timeout=5000, user.language=zh, sun.boot.library.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin, dialect=org.hibernate.dialect.Oracle10gDialect, java.version=1.6.0_13, user.timezone=America/Los_Angeles, sun.arch.data.model=64, java.endorsed.dirs=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\endorsed, sun.cpu.isalist=amd64, sun.jnu.encoding=GBK, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=CN, connection.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl, java.home=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre, java.vm.info=mixed mode, os.version=6.1, path.separator=;, connection.password=aaa519760, java.vm.version=11.3-b02, hibernate.connection.password=aaa519760, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=hibernate, user.home=C:\Users\zjlolife, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Java\jdk1.7.0_06\bin;D:\oracle\product\10.2.0\db_1\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Java\jdk1.7.0_06\bin;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Bitvise Tunnelier, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, connection.username=hibernate, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.Oracle10gDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=D:\Users\zjlolife\Workspaces\MyEclipse 10\hibernate\hibernateNo1\bin;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\antlr-2.7.6.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\commons-collections-3.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\dom4j-1.6.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\javassist-3.12.0.GA.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\jta-1.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\slf4j-api-1.6.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\hibernate3.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\optional\c3p0\c3p0-0.9.1.jar;F:\学习视频\zh\JDBC驱动大集合\oracle\ojdbc14.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\apache-log4j-1.2.17\log4j-1.2.17.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\slf4j-1.6.1\slf4j-log4j12-1.6.1.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, java.io.tmpdir=C:\Users\zjlolife\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=amd64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\ext;C:\windows\Sun\Java\lib\ext, user.dir=D:\Users\zjlolife\Workspaces\MyEclipse 10\hibernate\hibernateNo1, hibernate.c3p0.idle_test_period=3000, line.separator=
, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, hibernate.c3p0.acquire_increment=2, file.encoding=GBK, java.specification.version=1.6, hibernate.show_sql=true, hibernate.c3p0.max_statements=100}
00:12:46,217 DEBUG Configuration:1824 - Preparing to build session factory with filters : {}
00:12:46,270 DEBUG Configuration:3937 - Processing hbm.xml files
00:12:46,299  INFO HbmBinder:350 - Mapping class: com.zjlolife.hibernate.domain.User -> t_user
00:12:46,317 DEBUG HbmBinder:1337 - Mapped property: id -> id
00:12:46,328 DEBUG HbmBinder:1337 - Mapped property: name -> name
00:12:46,328 DEBUG Configuration:3967 - Process annotated classes
00:12:46,330 DEBUG Configuration:1436 - processing fk mappings (*ToOne and JoinedSubclass)
00:12:46,332 DEBUG Configuration:1678 - processing extends queue
00:12:46,332 DEBUG Configuration:1732 - processing extends queue
00:12:46,332 DEBUG Configuration:1681 - processing collection mappings
00:12:46,332 DEBUG Configuration:1691 - processing native query and ResultSetMapping mappings
00:12:46,333 DEBUG Configuration:1699 - processing association property references
00:12:46,333 DEBUG Configuration:1721 - processing foreign key constraints
00:12:46,333  INFO Configuration:1646 - Hibernate Validator not found: ignoring
00:12:46,337 DEBUG Configuration:1866 - Legacy Validator not present in classpath, ignoring event listener registration
00:12:46,340 DEBUG HibernateSearchEventListenerRegister:231 - Search not present in classpath, ignoring event listener registration.
00:12:46,340  INFO HibernateSearchEventListenerRegister:75 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
00:12:46,349  INFO ConnectionProviderFactory:173 - Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider
00:12:46,350  INFO C3P0ConnectionProvider:103 - C3P0 using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@127.0.0.1:1521:orcl
00:12:46,350  INFO C3P0ConnectionProvider:104 - Connection properties: {user=hibernate, password=****}
00:12:46,350  INFO C3P0ConnectionProvider:107 - autocommit mode: false
00:12:47,008  INFO SettingsFactory:117 - Database ->
       name : Oracle
    version : Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
      major : 10
      minor : 2
00:12:47,008  INFO SettingsFactory:123 - Driver ->
       name : Oracle JDBC driver
    version : 10.2.0.3.0
      major : 10
      minor : 2
00:12:47,043  INFO Dialect:108 - Using dialect: org.hibernate.dialect.Oracle10gDialect
00:12:47,060  INFO JdbcSupportLoader:108 - Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
00:12:47,064  INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions)
00:12:47,066  INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
00:12:47,067  INFO SettingsFactory:179 - Automatic flush during beforeCompletion(): disabled
00:12:47,067  INFO SettingsFactory:183 - Automatic session close at end of transaction: disabled
00:12:47,067  INFO SettingsFactory:190 - JDBC batch size: 15
00:12:47,067  INFO SettingsFactory:193 - JDBC batch updates for versioned data: disabled
00:12:47,068  INFO SettingsFactory:198 - Scrollable result sets: enabled
00:12:47,068 DEBUG SettingsFactory:202 - Wrap result sets: disabled
00:12:47,069  INFO SettingsFactory:206 - JDBC3 getGeneratedKeys(): disabled
00:12:47,069  INFO SettingsFactory:214 - Connection release mode: auto
00:12:47,070  INFO SettingsFactory:241 - Default batch fetch size: 1
00:12:47,070  INFO SettingsFactory:245 - Generate SQL with comments: disabled
00:12:47,070  INFO SettingsFactory:249 - Order SQL updates by primary key: disabled
00:12:47,070  INFO SettingsFactory:253 - Order SQL inserts for batching: disabled
00:12:47,070  INFO SettingsFactory:431 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
00:12:47,073  INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory
00:12:47,073  INFO SettingsFactory:261 - Query language substitutions: {}
00:12:47,073  INFO SettingsFactory:266 - JPA-QL strict compliance: disabled
00:12:47,073  INFO SettingsFactory:271 - Second-level cache: enabled
00:12:47,073  INFO SettingsFactory:275 - Query cache: disabled
00:12:47,073  INFO SettingsFactory:406 - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
00:12:47,075  INFO SettingsFactory:285 - Optimize cache for minimal puts: disabled
00:12:47,075  INFO SettingsFactory:294 - Structured second-level cache entries: disabled
00:12:47,081  INFO SettingsFactory:314 - Echoing all SQL to stdout
00:12:47,082  INFO SettingsFactory:323 - Statistics: disabled
00:12:47,082  INFO SettingsFactory:327 - Deleted entity synthetic identifier rollback: disabled
00:12:47,083  INFO SettingsFactory:343 - Default entity-mode: pojo
00:12:47,083  INFO SettingsFactory:347 - Named query checking : enabled
00:12:47,083  INFO SettingsFactory:351 - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
00:12:47,106  INFO SessionFactoryImpl:200 - building session factory
00:12:47,112 DEBUG SessionFactoryImpl:204 - Statistics initialized [enabled=false]}
00:12:47,116 DEBUG SessionFactoryImpl:226 - Session factory constructed with filter configurations : {}
00:12:47,117 DEBUG SessionFactoryImpl:230 - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl, sun.management.compiler=HotSpot 64-Bit Server Compiler, os.name=Windows Vista, hbm2ddl.auto=create, sun.boot.class.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\resources.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\rt.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\sunrsasign.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jsse.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\jce.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\charsets.jar;d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\classes, sun.desktop=windows, hibernate.c3p0.max_size=20, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_13-b03, hibernate.c3p0.min_size=1, user.name=zjlolife, connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.c3p0.timeout=5000, user.language=zh, sun.boot.library.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin, dialect=org.hibernate.dialect.Oracle10gDialect, java.version=1.6.0_13, user.timezone=America/Los_Angeles, sun.arch.data.model=64, java.endorsed.dirs=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\endorsed, sun.cpu.isalist=amd64, sun.jnu.encoding=GBK, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=CN, connection.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl, java.home=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre, java.vm.info=mixed mode, os.version=6.1, path.separator=;, connection.password=aaa519760, java.vm.version=11.3-b02, hibernate.connection.password=aaa519760, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=hibernate, user.home=C:\Users\zjlolife, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Java\jdk1.7.0_06\bin;D:\oracle\product\10.2.0\db_1\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Java\jdk1.7.0_06\bin;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Bitvise Tunnelier, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, connection.username=hibernate, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.Oracle10gDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=D:\Users\zjlolife\Workspaces\MyEclipse 10\hibernate\hibernateNo1\bin;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\antlr-2.7.6.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\commons-collections-3.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\dom4j-1.6.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\javassist-3.12.0.GA.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\jta-1.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\required\slf4j-api-1.6.1.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\hibernate3.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\hibernate-distribution-3.6.0.Final\lib\optional\c3p0\c3p0-0.9.1.jar;F:\学习视频\zh\JDBC驱动大集合\oracle\ojdbc14.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\apache-log4j-1.2.17\log4j-1.2.17.jar;F:\个人软件\hibernate-distribution-3.6.0.Final-dist\slf4j-1.6.1\slf4j-log4j12-1.6.1.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, java.io.tmpdir=C:\Users\zjlolife\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=amd64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=d:\Users\zjlolife\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\lib\ext;C:\windows\Sun\Java\lib\ext, user.dir=D:\Users\zjlolife\Workspaces\MyEclipse 10\hibernate\hibernateNo1, hibernate.c3p0.idle_test_period=3000, line.separator=
, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, hibernate.c3p0.acquire_increment=2, file.encoding=GBK, java.specification.version=1.6, hibernate.c3p0.max_statements=100, hibernate.show_sql=true}
00:12:47,132 DEBUG DefaultIdentifierGeneratorFactory:90 - Setting dialect [org.hibernate.dialect.Oracle10gDialect]
00:12:47,326 DEBUG AbstractEntityPersister:2934 - Static SQL for entity: com.zjlolife.hibernate.domain.User
00:12:47,327 DEBUG AbstractEntityPersister:2939 -  Version select: select id from t_user where id =?
00:12:47,327 DEBUG AbstractEntityPersister:2942 -  Snapshot select: select user_.id, user_.name as name0_ from t_user user_ where user_.id=?
00:12:47,327 DEBUG AbstractEntityPersister:2945 -  Insert 0: insert into t_user (name, id) values (?, ?)
00:12:47,327 DEBUG AbstractEntityPersister:2946 -  Update 0: update t_user set name=? where id=?
00:12:47,327 DEBUG AbstractEntityPersister:2947 -  Delete 0: delete from t_user where id=?
00:12:47,357 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [NONE]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,358 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [READ]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,358 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [UPGRADE]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update
00:12:47,358 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [UPGRADE_NOWAIT]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update nowait
00:12:47,359 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [FORCE]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update nowait
00:12:47,359 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [PESSIMISTIC_READ]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update
00:12:47,360 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [PESSIMISTIC_WRITE]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update
00:12:47,360 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [PESSIMISTIC_FORCE_INCREMENT]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=? for update nowait
00:12:47,361 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [OPTIMISTIC]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,361 DEBUG EntityLoader:123 - Static select for entity com.zjlolife.hibernate.domain.User [OPTIMISTIC_FORCE_INCREMENT]: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,371 DEBUG EntityLoader:56 - Static select for action ACTION_MERGE on entity com.zjlolife.hibernate.domain.User: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,372 DEBUG EntityLoader:56 - Static select for action ACTION_REFRESH on entity com.zjlolife.hibernate.domain.User: select user0_.id as id0_0_, user0_.name as name0_0_ from t_user user0_ where user0_.id=?
00:12:47,376 DEBUG SessionFactoryObjectFactory:61 - initializing class SessionFactoryObjectFactory
00:12:47,378 DEBUG SessionFactoryObjectFactory:99 - registered: 46d3cb90-30c4-4543-9ef8-47a199097712 (unnamed)
00:12:47,378  INFO SessionFactoryObjectFactory:105 - Not binding factory to JNDI, no JNDI name configured
00:12:47,378 DEBUG SessionFactoryImpl:367 - instantiated session factory
00:12:47,384 DEBUG Configuration:3937 - Processing hbm.xml files
00:12:47,384 DEBUG Configuration:3967 - Process annotated classes
00:12:47,384 DEBUG Configuration:1436 - processing fk mappings (*ToOne and JoinedSubclass)
00:12:47,384 DEBUG Configuration:1678 - processing extends queue
00:12:47,384 DEBUG Configuration:1732 - processing extends queue
00:12:47,384 DEBUG Configuration:1681 - processing collection mappings
00:12:47,384 DEBUG Configuration:1691 - processing native query and ResultSetMapping mappings
00:12:47,384 DEBUG Configuration:1699 - processing association property references
00:12:47,385 DEBUG Configuration:1721 - processing foreign key constraints
00:12:47,386 DEBUG DefaultIdentifierGeneratorFactory:90 - Setting dialect [org.hibernate.dialect.Oracle10gDialect]
00:12:47,386 DEBUG Configuration:3937 - Processing hbm.xml files
00:12:47,386 DEBUG Configuration:3967 - Process annotated classes
00:12:47,386 DEBUG Configuration:1436 - processing fk mappings (*ToOne and JoinedSubclass)
00:12:47,386 DEBUG Configuration:1678 - processing extends queue
00:12:47,386 DEBUG Configuration:1732 - processing extends queue
00:12:47,387 DEBUG Configuration:1681 - processing collection mappings
00:12:47,387 DEBUG Configuration:1691 - processing native query and ResultSetMapping mappings
00:12:47,387 DEBUG Configuration:1699 - processing association property references
00:12:47,387 DEBUG Configuration:1721 - processing foreign key constraints
00:12:47,388 DEBUG DefaultIdentifierGeneratorFactory:90 - Setting dialect [org.hibernate.dialect.Oracle10gDialect]
00:12:47,388 DEBUG DefaultIdentifierGeneratorFactory:90 - Setting dialect [org.hibernate.dialect.Oracle10gDialect]
00:12:47,392  INFO SchemaExport:234 - Running hbm2ddl schema export
00:12:47,393 DEBUG SchemaExport:252 - import file not found: /import.sql
00:12:47,393  INFO SchemaExport:262 - exporting generated schema to database
00:12:47,453 DEBUG SchemaExport:415 - drop table t_user cascade constraints
00:12:47,528 DEBUG SchemaExport:415 - drop sequence hibernate_sequence
00:12:47,553 DEBUG SchemaExport:415 - create table t_user (id number(10,0) not null, name varchar2(255 char), primary key (id))
00:12:47,638 DEBUG SchemaExport:415 - create sequence hibernate_sequence
00:12:47,643  INFO SchemaExport:281 - schema export complete
00:12:47,646 DEBUG SessionFactoryImpl:537 - Checking 0 named HQL queries
00:12:47,646 DEBUG SessionFactoryImpl:557 - Checking 0 named SQL queries
00:12:47,703 DEBUG SessionImpl:265 - opened session at timestamp: 13660963676
00:12:47,706 DEBUG JDBCTransaction:78 - begin
00:12:47,706 DEBUG ConnectionManager:444 - opening JDBC connection
00:12:47,706 DEBUG JDBCTransaction:83 - current autocommit status: false
00:12:47,710 DEBUG AbstractBatcher:410 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
00:12:47,710 DEBUG SQL:111 - select hibernate_sequence.nextval from dual
Hibernate: select hibernate_sequence.nextval from dual
00:12:47,838 DEBUG SequenceGenerator:118 - Sequence identifier generated: BasicHolder[java.lang.Integer[1]]
00:12:47,838 DEBUG AbstractBatcher:418 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
00:12:47,839 DEBUG AbstractSaveEventListener:134 - generated identifier: 1, using strategy: org.hibernate.id.SequenceGenerator
00:12:47,856 DEBUG JDBCTransaction:130 - commit
00:12:47,857 DEBUG AbstractFlushingEventListener:134 - processing flush-time cascades
00:12:47,859 DEBUG AbstractFlushingEventListener:177 - dirty checking collections
00:12:47,861 DEBUG AbstractFlushingEventListener:108 - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
00:12:47,862 DEBUG AbstractFlushingEventListener:114 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
00:12:47,863 DEBUG Printer:106 - listing entities:
00:12:47,863 DEBUG Printer:113 - com.zjlolife.hibernate.domain.User{id=1, name=张建}
00:12:47,868 DEBUG AbstractBatcher:410 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
00:12:47,868 DEBUG SQL:111 - insert into t_user (name, id) values (?, ?)
Hibernate: insert into t_user (name, id) values (?, ?)
00:12:47,883 DEBUG AbstractBatcher:66 - Executing batch size: 1
00:12:47,886 DEBUG Expectations:77 - success of batch update unknown: 0
00:12:47,886 DEBUG AbstractBatcher:418 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
00:12:47,888 DEBUG JDBCTransaction:143 - committed JDBC Connection
00:12:47,888 DEBUG ConnectionManager:427 - aggressively releasing JDBC connection
00:12:47,888 DEBUG ConnectionManager:464 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]

每个调试都可以看到相关的类名。。。。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值