《NHibernate in Action》读书笔记【一】

来源:互联网 发布:小区门禁开门软件 编辑:程序博客网 时间:2024/05/15 19:08

1) The core interface

   1.ISession interface :It exposes NHibernate's methods for finding,saving ,updating,and deleting objects. NHibernate sessions are not thread safe and should by design be used by only one thread at a time.

   2.ISessionFactory interface: The application obtains Isession instance from an IsessionFactory.

   3.Configuration  interface:  The Configuration object is used to configure NHibernate. the application used a Configuration instance to specfiy the location of mapping documents and to set NHibernate-specific properties before creating the ISessionFactory. It is the first object you'll meet when you being using NHibernate.

   4.Itransaction  interface :

   5.IQuery  interface: It is the basic interface used for fetching data using NHibernate. An IQuery instance is lightweight and can't be used outside the ISession that created it.

   6. ICriteria  interface:

 


 

 2) Types 

    An NHibernate Type object maps a .NET type to a database column type(the type may span multiple columns).

    NHibernate included a rich range of built-in types, covering all .NET primitives and many CLR classes, including types for System.DataTime,System.Enum,byte[] and Serializable classes.

    NHibernate supports user-defined custom types. The interface IUsertype,ICompositeUserType and IParameterizedType are provided to let you create your own types .You can also use IUSerCollectionType to create your own collection types.

原创粉丝点击