-->
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 simple Map<String, String> with annotatio
PostPosted: Sun May 20, 2007 8:40 am 
Newbie

Joined: Thu Apr 26, 2007 4:15 am
Posts: 9
Hi,

Is it possible to add a persistent property to an entity that has a simple Map<String,String> type? I'm having trouble finding the JPA-compliant way to do it (I've seen an example in the hibernate tests package that should do it using hibernate-specific annotations).

Is there a way to keep the simple Map<String,String> field using standard annotations?
The types/tables are something like what appears below:

Code:
@Entity @Table("customers") Customer {

  @Id int id;

  String name;

  [b]Map<String, String> properties[/b];
}

TABLE CUSTOMERS
-------------
ID      NAME
1       "James"
2       "John"

TABLE CUSTOMER_PROPERTIES
-------------
CUST_ID      PROP_KEY              PROP_VALUE
1            "PREFERRED_CHEESE"    "CHEDDAR"
1            "PREFERRED_MILK"      "LOW FAT"


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 6:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
not in the standard

_________________
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.