-->
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: Persisting a untyped Map using annotations
PostPosted: Sat Oct 01, 2005 3:24 pm 
Newbie

Joined: Sat Oct 01, 2005 3:03 pm
Posts: 1
Hibernate version: 3.1beta3, annotations 3.1beta5
Name and version of the database you are using: MySql 4.11

I would expect there are several ways of accomplishing this, but I haven't been able to find a way to persist an untyped Map with Hibernate/annotations. What additional annotations would I need to add to this class to be able to persist it?

Code:
@Entity
public class ConfigTest {
    private Map<Serializable, Serializable> items;
    public Map<Serializable, Serializable> getItems() { return items; }
    public void setItems(Map<Serializable, Serializable> items) { this.items = items; }
    public Serializable getItem(Serializable key) { return items.get(key); }
}


I'll keep rummaging the various forums, but would appreciate a pointer.

- S


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 8:06 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is somewhat quite complex to persist on any ORM unless you serialize everything in DB.
In this case you can use @Lob

_________________
Emmanuel


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