As reported since its begin, lazy properties are supported just for
autoproperties.

On Sun, Apr 29, 2012 at 10:19 PM, Joakim Gran <[email protected]>wrote:

> I'm trying to get my entities to work with NH3.3. If a lazy loaded
> property has been defined, methods and properties that access lazy
> loaded properties and fields doesn't trigger any load.
>
> It seems to me like the current version of NH only supports anemic
> entitys if a lazy property has been defined. No business logic can be
> placed in methods defined on the entity.
>
> This all worked very well in NH 3.1 with the castle bytecode proxy
> factory.
>
> Is there any chance that this could be resolved in the maintainance
> release? I really look forward to be able to upgrade...
>
>    public class Book
>    {
>        protected virtual byte[] LazyPdf { get; set; }
>        protected readonly IList<BookToc> _tocs;
>
>        public virtual byte[] GetLazyLoadedPdf()
>        {
>            return LazyPdf;
>        }
>
>        public virtual IEnumerable<BookToc> Tocs
>        {
>            get{ return _tocs.AsEnumerable(); }
>        }
>    }
>
> Mappings:
>  <bag access="field.camelcase-underscore" cascade="all-delete-orphan"
> inverse="true" name="Tocs">
>   <key>
>      <column name="boId" />
>   </key>
>      <one-to-many class="BookToc" />
> </bag>
>
> <property name="LazyPdf" type="BinaryBlob" lazy="true">
>   <column name="PDFBook" />
> </property>
>
> Relates issues:
> https://nhibernate.jira.com/browse/NH-3132
> https://nhibernate.jira.com/browse/NH-3058
>
> /Joakim
>



-- 
Fabio Maulo

Reply via email to