Session session=new Configuration().configure().buildSessionFactory().openSession();
============================
Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.StringType
at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:81)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:147)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at tmh.util.testsf.main(testsf.java:12)
------解决方法--------------------------------------------------------
你的类型映射有错误