[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5398) PersistentMap.keySet seems to produce a set containing values rather than keys.
rufus hamade (JIRA)
noreply at atlassian.com
Fri Jul 23 08:09:36 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37888#action_37888 ]
rufus hamade commented on HHH-5398:
-----------------------------------
Unfortunately, I've changed my code so it doesn't try to do this any more. Using a persistent Map was overkill for my current purposes anyway; I was just using it to ensure each actor was in the list only once. I'll see if I can get a test case running and test it out with the latest Hibernate. It may take me a while though as I am pressed for time at the moment. (Though aren't we all:-P)
> PersistentMap.keySet seems to produce a set containing values rather than keys.
> -------------------------------------------------------------------------------
>
> Key: HHH-5398
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5398
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.3.0.SP1
> Environment: Also Hibernate EntityManager 3.4.0 if that is relevant.
> Reporter: rufus hamade
>
> I have a persistent Map defined as follows:
> @Entity
> public class Task {
> [snip]
> @OneToMany(mappedBy="task")
> @MapKey(name="actor")
> private Map<Long, TaskCC> ccs = new HashMap<Long, TaskCC>();
> }
> where
> @Entity
> public class TaskCC {
> @Id
> @GeneratedValue
> private Long id;
> @ManyToOne(fetch=FetchType.LAZY)
> private Task task;
>
> @ManyToOne(fetch=FetchType.LAZY)
> @AccessType("field")
> private Actor actor;
> }
> and actor is an independent entity (i.e., no associations to Task or TaskCC) with a Long id field.
> We have some code that does something like:
> ids = new HashSet<Long>(bug.getCcs().keySet());
> But the ids set seems to contain the Actors rather than the Actor IDs.
> Let me know if the above is not sufficient and/or you want me to create a simplified test case for this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list