Browse by Tags
All Tags »
O/RM (
RSS)
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,...
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...
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...
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...
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...
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...
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...
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...
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...
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 »