-->
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: Map<String, String> Annotation with Clob value
PostPosted: Sun Sep 25, 2011 11:33 am 
Newbie

Joined: Sun Sep 25, 2011 11:09 am
Posts: 1
Hi,

I am looking for a way to annotate a CollectionOfElements of type Map<String, String> so that the value column of the Map is created by Hibernate as a @Lob or @Clob

my current code which works fine in handling the Map but creates a table "additional_data" with column "value" as VARCHAR, while I need a CLOB:

Code:
@Entity
public class MyObject{

    // .. id annotations here..
    public Long id;

    @CollectionOfElements(fetch=FetchType.EAGER)
    @JoinTable(name="additional_data",
      joinColumns = @JoinColumn(name="id"))
    @MapKey(columns={@Column(name="name")})
    @Column(name="value")
    public Map<String, String> getAdditionalData() {
      return this.additionalData;
    }
}


I have tried different "positions" for the @Lob annotation but I cannot find something which works, searching through the forum I found no hint.

Thanks


Francesco


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.