-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: net.sf.hibernate.collection.Map$MapEntryProxy problem/?
PostPosted: Mon Sep 22, 2003 1:46 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
I have an issue with proxied Maps that I'm not quite sure how to work around without changing to another type (such as Set).

I have a JSP Tag that iterates through a Map/Collection of beans and renders a customized display. The logic in the tag expects the entries in the Map to be instances of a certain class and as such tests via
Code:
// ...
Object bean = iterator.next();
if (bean instanceof MyExpectedClass) {
// ...

The problem is that this fails because net.sf.hibernate.collection.Map$MapEntryProxy is not an instance of MyExpectedClass. Can anyone offer some direction on this?

I can switch to using a Set instead of a Map but I would like to know how to solve the problem (or if I can) rather than just working around it without knowing what exactly is going on.

Thank-you,
David


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 2:23 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
The object you have is a Map.Entry. The bean is probably the value of the entry, e.g. ((Map.Entry)it.next()).getValue().

Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.