Development With A Dot

Blog on development in general, and specifically on .NET

Sponsors

My Friends

My Links

Permanent Posts

Portuguese Communities

Browse by Tags

All Tags » NHibernate » .NET (RSS)
NHibernate Metadata
I know that O/RMs like NHibernate are supposed to shield us from the gory database internals such as tables, views, columns and such; however, at times, I do have the need to know how my domain model translates to the database. NHibernate, of course,...
Querying an Uninitialized Collection with NHibernate
I have talked before about the problem of accessing an uninitialized collection and presented a solution that allows us to see if the collection contains elements on the DB, and how many there are, without actually loading them. Now I have a general purpose...
NHibernate Pitfalls: SQL Queries and Parameter Prefix
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . When you execute an SQL query with NHibernate with named parameters, you would perhaps expect them to be prefixed with a symbol specific to the current DB you...
Checking if an Unloaded Collection Contains Elements with NHibernate
If you want to know if an unloaded collection in an entity contains elements, or count them, without actually loading them, you need to use a custom query; that is because the Count property (if the collection is not mapped with lazy=”extra” ) and the...
NHibernate Pitfalls: Lazy Entities and Virtual Members
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . If you want to lazily load an entity as part of a many to one or one to one endpoint, you must declare it as lazy. This way, a proxy can be generated for it...
NHibernate Pitfalls: Fetch and Lazy
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . When we use the fetch mode join for an association, we are implicitly using eager fetching, not lazy . Because the SELECT statement for the root entity already...
NHibernate Pitfalls: SELECT N + 1
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . One of the recurring situations when accessing a list of entities and changing them is the SELECT N + 1 problem; it is an anti-pattern that, although won’t throw...
NHibernate Pitfalls: Merge
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . Sometimes there may be the need to store a loaded entity in a place that outlives the session that retrieved it. Later on, you need to associate this entity...
NHibernate Pitfalls: Lazy Properties and Closed Sessions
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . Beware when accessing previously un-accessed lazy properties (simple properties, many to one, one to one, many to many, one to many) outside the scope of its...
NHibernate Pitfalls: Entity Refresh
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . Whenever an entity is loaded from NHibernate, either by its direct id, by LINQ, Criteria API, Query Over or HQL, it is stored in the first level cache. After...
More Posts Next page »