Disable lazy loading default

29 views
Skip to first unread message

Tim Copenhaver

unread,
Aug 19, 2011, 11:42:50 AM8/19/11
to ConfORM
We are currently working on a project where we need to disable lazy
loading for all of our entities. In effect, we want the generated
mapping to set the default-lazy attribute on the Hibernate-Mapping
element:

<hibernate-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
assembly="My.Assembly" xmlns="urn:nhibernate-mapping-2.2" default-
lazy="false">

Is there a way to customize ConfORM to make it set this attribute?
I've seen some examples of trying to set this for individual
properties (which I really didn't follow very well), but we want it
for all classes and all properties.

Fabio Maulo

unread,
Aug 19, 2011, 12:13:25 PM8/19/11
to codec...@googlegroups.com
it is so simple as
var wholeDimainMappingToAddToNH = mapper.CompileMappingFor(yourTypes);
wholeDimainMappingToAddToNH.defaultlazy = false;
--
Fabio Maulo

Reply all
Reply to author
Forward
0 new messages