2

I've got some binary data that I store and was going to separate this out into a separate table so it could be lazy loaded.

However, i then came across this post by Ayende (http://ayende.com/Blog/archive/2010/01/27/nhibernate-new-feature-lazy-properties.aspx) which suggests that property lazy loading is now possible.

I have added the lazy="true" attribute to my property mapping but the field is still loaded from the database (I am using a simple text field to test).

My query:

                return _session.CreateQuery("from Product")
                .SetMaxResults(1)
                .UniqueResult<Product>();

Mapping:

<property name="Description" type="string" column="FullDescription" lazy="true"/>

Has anyone been able to get this working? Personally I prefer this approach than having to add another table to my database.

1

2 Answers 2

3

As the article states: "This feature is now available on the NHibernate trunk". So either NH 3.0 or the latest trunk.

Sign up to request clarification or add additional context in comments.

Comments

2

It will be possible on nhibernate 3.0, on the current version is not possible. You can download the trunk code or wait for the 3.0 version :-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.