I have a related follow-up question. I was getting a stack overflow at
runtime because of the polymorphic hierarchy and was not using @ExtraTypes.
My hierarchy was 3 levels deep. Top level is GenericType, next level is
CategoryType and EventType, and next level is four subtypes of CategoryType
and 4 subtypes of EventType.
I finally got it working by putting @ExtryTypes in my request factory. It
only worked when I put the @ExtraTypes with the full list of 10 types above
GenericType. Initially I had tried to put @ExtraTypes with just 2 types
above GenericType and @ExtraTypes with 4 types each above CategoryType and
EventType. This did not work.
Is this how it is intended to work?
A related question. At one point I download all GenericTypes in the
datastore (I use Objectify) and I want to see which of the lowest 8 types a
particular entity is. I am currently comparing the String of the class I
am looking for with substring of the class name of the GenericType. When I
do getClass().getName() on the GenericType, returned from the datastore, I
get something like:
com.packagename.shared.proxy.LevelThreeTypeProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory$1
If I am trying to see if this is a
'com.packagename.shared.proxy.LevelThreeTypeProxy',
i compare that string to the left substring with length of whatever the
fully qualified name I'm looking for is.
Is there a better way to do this?
Thanks,
Jonathan
On Saturday, February 23, 2013 6:33:55 AM UTC-5, Thomas Broyer wrote:
>
>
>
> On Saturday, February 23, 2013 5:20:23 AM UTC+1, Bademus ᵗʰᵉ wrote:
>>
>> It seems that GenTool goes into infinite loop again
>>
>> Version: gwt 2.5.1-rc1
>> Code:
>> public interface EntityBaseProxy extends EntityProxy { ... }
>>
>> @ExtraTypes(AuthorProxy.class)
>> public interface UserProxy extends EntityBaseProxy { ... }
>>
>> public interface AuthorProxy extends UserProxy { ... }
>>
>
> It's no news actually (and Brad was right, and I was wrong):
> https://code.google.com/p/google-web-toolkit/issues/detail?id=6912
> Workaround: don't put @ExtraTypes on the super-interface of the "extra"
> interfaces (e.g. move @ExtraTypes to a RequestContext)
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.