You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Flasby <st...@flasby.org> on 2009/04/01 12:35:53 UTC

Application & IConverterLocator when using Hibernate & friends

Chaps,
	need a hint please.

I have my own IConverterLocator which provides standard display of
things like Money, Percentage & other domain types we have invented.

All is good.

Today I enhanced it to handle our Country type. This is an @Entity.
To my surprise the rendering didn't change. It seems I am getting
a wrapped class back from Hibernate (CGLIB artifact) rather than the
real type. (I guess I should have known this already).

The IConverterLocator doesn't know about this class, and can't as it
is dynamically created. Can anyone suggest a way of handling this?


Cheers - Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Application & IConverterLocator when using Hibernate & friends

Posted by francisco treacy <fr...@gmail.com>.
something like this might be of help?

if (entity instanceof HibernateProxy) {
			entity = (T) ((HibernateProxy)
entity).getHibernateLazyInitializer().getImplementation();
		}

francisco



2009/4/1 Steve Flasby <st...@flasby.org>:
> Chaps,
>        need a hint please.
>
> I have my own IConverterLocator which provides standard display of
> things like Money, Percentage & other domain types we have invented.
>
> All is good.
>
> Today I enhanced it to handle our Country type. This is an @Entity.
> To my surprise the rendering didn't change. It seems I am getting
> a wrapped class back from Hibernate (CGLIB artifact) rather than the
> real type. (I guess I should have known this already).
>
> The IConverterLocator doesn't know about this class, and can't as it
> is dynamically created. Can anyone suggest a way of handling this?
>
>
> Cheers - Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org