junit測試出錯org.hibernate.MappingException: Unknown entity: com.entity.Student
六月 28, 2016 8:00:54 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.0.Final}
六月 28, 2016 8:00:54 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
六月 28, 2016 8:00:54 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
六月 28, 2016 8:00:54 下午 org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity
WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead. ?Support for obsolete DTD/XSD namespaces may be removed at any time.
六月 28, 2016 8:00:54 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
六月 28, 2016 8:00:54 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
六月 28, 2016 8:00:54 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/hibernate]
六月 28, 2016 8:00:54 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=root, password=****}
六月 28, 2016 8:00:54 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
六月 28, 2016 8:00:54 下午 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
六月 28, 2016 8:00:55 下午 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
六月 28, 2016 8:00:55 下午 org.hibernate.tool.schema.internal.SchemaCreatorImpl applyImportSources
INFO: HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@6e2aa843'
六月 28, 2016 8:00:55 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
INFO: HHH10001008: Cleaning up connection pool [jdbc:mysql://localhost:3306/hibernate]
2016-09-10
新版本的hibernate和舊版的生成sessionfactory的方式不一樣
2017-02-28
// 獲得 session工廠
sessionFactory = new Configuration().configure().buildSessionFactory();
// 獲得 session
session = sessionFactory.getCurrentSession();
// 開啟事務(wù)
transaction = session.beginTransaction();
2016-09-02
同學(xué)我和你是一樣的錯誤,你現(xiàn)在解決了嗎?
2016-06-28
實體類配置出錯 hibernate不識別 檢查配置文件 是否類的名稱寫錯 還有g(shù)etter setter方法是否寫錯都有可能出錯