Download presentation
Presentation is loading. Please wait.
Published bySylvia Riley Modified over 8 years ago
2
Who I am What is NHibernate? ◦ Object Relational Mapper ◦ A framework for building advanced frameworks ◦ Ported from Java ◦ A wide NHibernate ecosystem now exists ◦ Why ORMs?
3
Download and add necessaryreferences Intellisense Show common exceptions Configure mapping files Configure configuration files Create repository
4
ITransaction ISession ISessionFactory Configuration IUserType ICompositeUserType Statistics IInterceptor IEventListener Custom defined mappings Interception Instrumentation Core API IQuery ICriteria Querying
5
Many-to-one Cascading One-to-many Components Assigned keys
6
Table per class hierarchy ◦ One table represents an aggregate ◦ Simple and good performance wise ◦ Loss of not-null constraints Table per concrete class ◦ One table for each non-abstract class ◦ Can be problematic for polymorphic queries Table per subclass ◦ Completely normalised ◦ Polymorphic queries possible
7
NamingStrategy IUserType ICompositeUserType Should be an exception more that the rule
8
Event listeners Interceptors ◦ Refer to empty interceptor implementation ◦ Refer to profiler interceptor setting
9
HQL ICriteria API Query By Example (QBE) Linq to NHibernate Straight SQL
10
New feature added at NHibernate 2.0 Exists at both SessionFactory and Session Must turn statistics on, off by default Refer to SessionFactoryStatisticsBuilder
11
First level Caching ◦ Default caching level ◦ Caching at the session level Second level Caching ◦ Must be configured at Configuration and entity itself ◦ Caching at the session factory level ◦ Providers such as memcached, nvelocity supported
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.