NHiberante Lazy OneToOne

Posts   
 
    
Posts: 1
Joined: 14-Dec-2011
# Posted on: 14-Dec-2011 08:46:54   

Hello,

If have a project with fluent NHibernate mappings und LLBLGen(Pro 3.0 Final July 16th, 2010) worked fine for me so far. Nice Work!

The template (I assume 'entityFluentMapping.lpt') generates something like ...

HasOne(x=>x.Mandant_OV)
      .Access.CamelCaseField(Prefix.Underscore)
      .Cascade.None()
      .LazyLoad()
      .Constrained();

...where unfortunately the lazy loading does not work, which is a problem for me because there are a lot of 1:1 relations. I know this is a problem of nhibernate not of LLBLGen. So I want to change the generated Code to something like

References(x => x.Mandant_OV)
     .Access.CamelCaseField(Prefix.Underscore)
     .Cascade.None()
     .Columns("OD_MdNr");

If I have a look in 'entityFluentMapping.lpt' I can see there is a section to do this for OneToOne Mappings, but I can't find the right option in LLBLGen. Also I tried to change the template but the code generation produces an exception(see attachment).

I only made a single simple change to the template, so i don't think i've done something wrong. Also other template bindings are working fine. (Made some changes to the sessionmanager and project templates)

Is there an option in LLBLGen to change the generated code or can u help me with the templatebinding for 'entityFluentMapping.lpt'?

Felix

Attachments
Filename File size Added on Approval
codegeneration_with_entityFluentMapping.txt 3,228 14-Dec-2011 08:48.36 Approved
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2011 15:59:59   

PLease describe (post) the change you have made to the template.

Also what does: "enthält keine" means?