Hi,
I've been having some trouble with using an Interface as a proxy when I have a property in the implementation where there is no setter. I raised this problem before in the following post but haven't been able to resolve it as yet:
http://nhibernate.sourceforge.net/forum/viewtopic.php?t=751
I have many classes that I want to have properties which only implement a getter and have NHibernate use field access only so that it's not subject to any of the property restrictions. I also need to be able to implement Interfaces because I have an inheritance problem that can't be solved without without using them.
To paraphrase from the Hibernate docs in section 14.2:
Quote:
There are some gotchas to be aware of when extending this approach to polymorphic classes...instances of Cat will never be castable to DomesticCat, even if the underlying instance is an instance of DomesticCat. If you wish to avoid these problems your persistent classes must each implement an interface that declares its business methods.
Since that thread I've done some trawling on the Hibernate site to see whether anyone over there had a solution and it looks a bit like someone has:
http://forum.hibernate.org/viewtopic.php?t=937087
The problem is that I can't quite work out how this solution can be implemented in NHibernate...the structure of C# classes is slightly different with regards to properties and I'm really floundering around here.
Does anyone out there have any thoughts on what I need to do to resolve this issue?
Cheers,
Symon.