-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate and java.util.map
PostPosted: Sun May 01, 2011 2:36 pm 
Newbie

Joined: Sun May 01, 2011 2:23 pm
Posts: 10
I am new to hibernate.

I am using hibernate-core and hibernate-annotation – 3.5.1.

I have a java class – event – that has an ‘id’ – within a Spring MVC application that is stored in the database using Hibernate.

Code:
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;


This generated ‘id’ is passed back to originating user in an HTTP response.

I would therefore like to use a map of ‘events’ with a key of ‘id’ so that on ‘deletion’/’change’ based on ‘id’ no search is necessary.
I have looked at many of the Hibernate / java.util.map websites but I am not sure if it is possible to auto generate the ‘key’ to a map and if so how the annotation / ‘code to put entries into the map’ would work.

Thanks for any help.


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.