看来是我理解错了,我刚查找了api --------------------------------------------------------------------------------public class Configuration extends Object An instance of Configuration allows the application to specify properties and mapping documents to be used when creating a SessionFactory. Usually an application will create a single Configuration, build a single instance of SessionFactory and then instantiate Sessions in threads servicing client requests. The Configuration is meant only as an initialization-time object. SessionFactorys are immutable and do not retain any association back to the Configuration.A new Configuration will use the properties specified in hibernate.properties by default. Configuration是类。 至于为什么称为 interface,我也有点郁闷,不过我以前在Servlet的api 中看到的接口像我上面说的那样 他们却是接口,只是里面的方法已经实现了,也是可以实例化的。
private static Configuration configuration = new Configuration();如果是接口,怎么可能直接new出对象来?呵呵。其二:以下是从Hibernater的API doc中拷过来的内容
public class Configuration
extends Object
implements Serializable非常明显,Configuration是“class”,而不是“interface”
这里可以把Configuration接口等其他Hibernate中的核心接口当作类来看待,
但他们却是接口,只是里面的方法已经实现了,也是可以实例化的。
--------------------------------------------------------------------------------public class Configuration
extends Object
An instance of Configuration allows the application to specify properties and mapping documents to be used when creating a SessionFactory. Usually an application will create a single Configuration, build a single instance of SessionFactory and then instantiate Sessions in threads servicing client requests. The Configuration is meant only as an initialization-time object. SessionFactorys are immutable and do not retain any association back to the Configuration.A new Configuration will use the properties specified in hibernate.properties by default. Configuration是类。
至于为什么称为 interface,我也有点郁闷,不过我以前在Servlet的api 中看到的接口像我上面说的那样
他们却是接口,只是里面的方法已经实现了,也是可以实例化的。