final getters and setters Exception

803 views
Skip to first unread message

Jan Limpens

unread,
Sep 2, 2008, 4:47:23 PM9/2/08
to nhu...@googlegroups.com
I get these entries in my log:

2008-09-02 17:33:53,121 [20] ERROR
NHibernate.Tuple.Entity.PocoEntityTuplizer [(null)] - Setters of lazy
classes cannot be final: Businesslayer.ShoppingCart.ItemList
2008-09-02 17:34:52,132 [21] ERROR
NHibernate.Tuple.Entity.PocoEntityTuplizer [(null)] - Getters of lazy
classes cannot be final: Businesslayer.ShoppingCart.ItemList

for this:
<bag name="ItemList"
cascade="all-delete-orphan"
inverse="true">
<key column="ShoppingCartID" />
<one-to-many class="ShoppingCartItem"/>
</bag>

and:
protected IList<ShoppingCartItem> ItemList { get; set; }

It does not seem to do anything bad, still, is there something I can
do to make it go away? IList is not final, ShoppingCartItem isn't.

--
Jan
___________________
j...@limpens.com
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339

Tuna Toksöz

unread,
Sep 2, 2008, 4:49:37 PM9/2/08
to nhu...@googlegroups.com
make it public virtual.

Tuna Toksöz

Typos included to enhance the readers attention!

Jan Limpens

unread,
Sep 2, 2008, 5:15:30 PM9/2/08
to nhu...@googlegroups.com
Can't expose them like that. Would it be better to access this via a
field, then?

Tuna Toksöz

unread,
Sep 2, 2008, 5:18:50 PM9/2/08
to nhu...@googlegroups.com
Maybe protected virtual also works?



Tuna Toksöz

Typos included to enhance the readers attention!


Jan Limpens

unread,
Sep 2, 2008, 5:33:44 PM9/2/08
to nhu...@googlegroups.com
yip it does, thanks!

Ken Egozi

unread,
Sep 3, 2008, 2:48:39 AM9/3/08
to nhu...@googlegroups.com
the "cannot be final" is a residue from Java days. should all of these be turned into "must be virtual"?

Jan Limpens

unread,
Sep 3, 2008, 8:37:43 AM9/3/08
to nhu...@googlegroups.com
probably. the funny thing is, that I did not even think of such an
obvious solution because I am so totally spoiled by the usual
exception nh throws with public non virtual properties, that it did
not even ocurr to me that this could be the cause. Still strange that
I can use non virtual fields for the mapping without these warnings.

Fabio Maulo

unread,
Sep 3, 2008, 12:28:16 PM9/3/08
to nhu...@googlegroups.com
The "bug" of proxyvalidator was fixed in the trunk so, now, you will have the early exception.
BTW I'm thinking to change something there... probably move the responsibility to provide a proxyValidator to the ProxyFactoryFactory and I hope to see some other "proxy-provider" soon (I like Castle.DynamicProxy2 but I don't like the fact that it is the only available option in NH).

2008/9/3 Jan Limpens <jan.l...@gmail.com>



--
Fabio Maulo
Reply all
Reply to author
Forward
0 new messages