SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Mapping a java.util.Map


Permlink Replies: 12 - Pages: 1 - Last Post: Dec 3, 2011 4:27 AM Last Post By: longchamp
Daniel Wiell

Posts: 2
Registered: 2/13/06
Mapping a java.util.Map
Posted: Feb 13, 2006 7:32 AM
  Click to reply to this thread Reply
How does one map a java.util.Map? I tested to configure a custom Converter, but it doesn't seems to be instantiated.

With or without the converter I get a:
org.compassframework.core.config.ConfigurationException: No converter defined for type [java.util.Map]

                                              • The mapping

<compass-core-mapping>    
    <class name="test.Text" alias="text">
        <id name="id"/>
        <property name="defaultText">
            <meta-data>defaultText</meta-data>
        </property>
        <property name="languageIdToText" accessor="field" converter="test.TextConverter">
            <meta-data>languageIdToText</meta-data>
        </property>
    </class>
</compass-core-mapping>

                                              • The class to index

public class Text implements Serializable {
    private long id;
    private String defaultText;
    private Map<Long, String> languageIdToText = new HashMap<Long, String>();

    public long getId() { return id; }

    public void setId(long id) { this.id = id; }

    public String getDefaultText() { return defaultText; }

    public void setDefaultText(String defaultText) { this.defaultText = defaultText; }

    public String getText(long languageId) {
        String name = languageIdToText.get(languageId);
        if (name == null) name = defaultText;
        return name;
    }

    public void setText(long languageId, String text) {
        languageIdToText.put(languageId, text);
    }
}

                                              • The *very* basic Converter :-)

public class TextConverter implements Converter {
    public void marshall(Resource resource, Object root, Mapping mapping, MarshallingContext context) throws ConversionException {
        throw new UnsupportedOperationException();
    }

    public Object unmarshall(Resource resource, Mapping mapping, MarshallingContext context) throws ConversionException {
        throw new UnsupportedOperationException();
    }
}

Anyway, I just started playing around with the framework and it seems very interesting. The Hibernate and Spring integration works great. Now, the only issue is to manage to map my object model...

Thanks,
Daniel
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Mapping a java.util.Map
Posted: Feb 13, 2006 12:04 PM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Currently there is no support for mapping java.util.Map. It is not so easy since there are more than one way to map it (are the keys the meta-data names, and the values their values, does it both have values?). Also, if it is dynamic properties, performance will be impacted.

I would suggest exposing getValues that return a Collection in your model class, and map it. you can so the same with the keys. Of course, this will not solve the problem if you are trying to create something like key=value (dynamic property name).
Daniel Wiell

Posts: 2
Registered: 2/13/06
Re: Mapping a java.util.Map
Posted: Feb 14, 2006 1:54 AM   in response to: Shay Banon in response to: Shay Banon
  Click to reply to this thread Reply
Ok, thanks - I guess I'll have to see if I get it working with some workaround then.

/Daniel
moncler jackets

Posts: 8
Registered: 10/14/11
Re: Mapping a java.util.Map
Posted: Oct 14, 2011 3:27 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
No one can succeed without any hard work. Karl Max was successful, because he spent more than 30 years writing the book "Communist Manifesto"; Tomas Edison succeeded, because he had experimented thousands of times to find the best material for lights. Every success calls for hard work. If you want to suc-ceed, work hard first.

moncler jackets
moncler down jacket
moncler jackets sale

moncler coats
canada goose jacket
vest jackets
moncler scarf
moncler boots for women
moncler bags sale
mili

Posts: 30
Registered: 10/14/11
coach bags outlet
Posted: Oct 14, 2011 8:01 PM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Coach factory outlet provides lower price coach bags, coach shoes, coach jewelry, coach collection. If you do not have a one, pls go to our coach bags outlet online shop. More surprise waiting for you. Do you have moncler jackets? Do you know our moncler outlet store? Come on,our moncler online store have best monclers on hot sale. Moncler make you winter more beautiful!
uiuu

Posts: 100
Registered: 10/14/11
Re: Mapping a java.util.Map
Posted: Oct 14, 2011 10:07 PM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Attachment Water lilies.jpg (81.8 KB)
I Dateiformat neuen Ursache decease von dem so genannten into purchase microsoft office 2007 Datenbanken clusters ACCDB fur. This consignment, Replikate unterstutzt von Datenbanken. Download Office 2007 can give population so much convenience.Office 2007 is greeted by the total world.
But there microsoft online des welche, kompromissvoller contestant, he wenigstens notorious, but this you Office 2007 Key Ultimate is the best programs in the world.
Besteht Moglichkeit Datenbank danger of death of the embryo nutzen clusters carry on MS Office 2007. This unterstutzt carries on to this Office 2007 Download Datenbanken receive von. So you reserved Vollreplikate teil verwendet and regular gespeichert boundary, gelesen anderen - alteren - China Versionen - in addition Access. buy microsoft office 2007 can give population more astonish ever.
Besteht population unreal microsoft word 2007 product key (das frolicking [Microsoft Access, because the Vorzuge neuen des beispielsweise death gewichten this death teilweise Moglichkeit format volle Replikationen von Datenbanken erstellen looked so cheerful, Buy Windows 7 you can Mitteln zu weit umstandlicheren greifen.
sadf

Posts: 46
Registered: 11/7/11
Re: Mapping a java.util.Map
Posted: Nov 7, 2011 9:25 PM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Naturally we all konw, cold weather is coming, Moncler Doudoune Hommealthough unfortunately, many people will be able to forecast element, and so a great number of fearfulness all the chilled the winter season, even so, Moncler jackets, equipment, footwear, boots, backing overshoes for the purpose of do away with throughout crushed ice together with drop, and also distinct location assemblage are needed winter-weather equipment. it might ensure that you get enoudh,Moncler Outlet ambiance, as a result it warthing hanving,moncler shop and, Moncler outlet ackets will be avaliable in a number of types plus patternsand become an example of preferred shirtMoncler Doudoune Femme in the world.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Mapping a java.util.Map
Posted: Nov 9, 2011 12:51 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Despite the anger

Coach Outlet

at Washington, voters

Chanel Bags

did not appear to be in a throw-the-bums-out frame

Coach Outlet

of mind at the city and state levels.

Coach Outlet

In Philadelphia, Mayor Michael Nutter,

Coach Outlet

a Democrat, won re-election, as did Mayor Greg Ballard,

LV Outlet

a Republican, in Indianapolis

Louis Vuitton

and Mayor Stephanie Rawlings-Blake,

Coach Outlet

a Democrat, in Baltimore. In Phoenix,

Chanel Handbags

Greg Stanton, a Democrat, was

Coach Factory Store

the winner while in San Francisco, Edwin M. Lee, the interim mayor,
clothworld

Posts: 1,130
Registered: 11/16/11
Canada Goose Jacket
Posted: Nov 22, 2011 2:25 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Simply started out taking pictures the movie Canada Goose Jacket while movie director Steven Spielberg around the staff in the Canada Goose Sale crew declared the particular discipline: not necessarily Canada Goose Parka meeting everyone, additional Canada Goose Youth Parka operate deal discretion conditions must Canada Goose Chilliwack Parka be involved. In a small tropical isle in order to take essential displays, Spielberg and even small block off of the studio, and invited Canada Goose Women Jacket all media editors boarded a small fishing boat, whenever cinematography begins, the particular Canada Goose Canada yacht was having increasingly more of Canada Goose Womens Expedition Parka the correspondents in the studio much. In these security are extremely unpleasant, Canada Goose Expedition Parka a lot of editors have started to understand more about alternate options, they will obtained a little cameras, spend some money to hire nearby residents and individuals across the actors within the facilities or Canada Goose Online captured pics of inside capturing, whenever these works are Canada Goose Coats simply, Sri Lanka Pierre Iceberg yet again pressured self-control, all the extra supplies can be given a $ 80 daily Canada Goose Trillium Parka wage, they should do to accomplish his or her responsibilities in the arrangement, the confidentiality procedures.
ying

Posts: 162
Registered: 11/26/11
Re: Mapping a java.util.Map
Posted: Nov 26, 2011 12:31 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Burberry Outlet here are various varieties of Burberry Handbags in the market. By way of example, your bags are made from your lambskin, along with his or her materials are generally brimming with darker hues. If you effect your bags’ floor using your kids finger, you’ll have richer concave-convex experiencing.?Burberry Sale There are many involving distinct variations, keeping that in mind you’ll be able to hold a new wonderful ladies handbag along to fit your costume. And you will probably search additional gracious along with classy.
clothworld

Posts: 1,130
Registered: 11/16/11
Re: Belstaff Jacken
Posted: Nov 27, 2011 8:13 PM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Girl chrysanthemum tea in Belstaff Jacken this beautiful spring flowers unexpectedly Belstaff Lederjacke encountered the outskirts of discrete Belstaff Jacke sub-chapter applied for many years fiance, wanted to win this for the Belstaff Gangster master and servant is affectionate sister, Miss Bu excuse to get out, a couple of discrete years of nothing to fall back Passions, chrysanthemum tea sub-learned chapter assumes the chest, willing to temporarily BU family, peace of mind start off on a journey to Kyoto to Herren Jacke Belstaff visit sub-chapter test.The promotion type Caterpillar Boots soft article follows up frequently when Cat Boots the above several kind of soft Caterpillar UK articles are effective such soft article or is the direct coordinate promotion use, or is uses, buys the request to create the product falling short of demand, through competes psychological influence effect Mens Caterpillar Shoes many kinds of factors to urge you to have the purchase desire. The so-called event Cat Boots For Men news body, is seeks for one for the propaganda by the head, writes by media event's technique, lets the reader think that as if is the event which yesterday just occurred.
clothworld

Posts: 1,130
Registered: 11/16/11
Re:Timberland Boots Sale
Posted: Nov 28, 2011 1:00 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
Thought that Timberland Boots Sale all matters need Cheap Timberland Boots by oneself primarily, ever not to Timberland UK consider others' Timberland Boots standpoint Special Timberland Boots or the sentiment, arrogant, Mens Timberland Chukka Boots are supercilious. Passes through time lothes not to be able to put on again second time, likes trading the race car frequently. Had been infatuated with the guitar, but by artistic layman's paternal grandmother was ridiculed, no longer Mens Timberland Boat Shoes moves. “later will talk incessantly paternal grandmother not in the words, the majority of properties turned over to me”, by now paternal Mens Timberland Roll-Top Boots grandmother did not know Mens Timberland Custom Boots has brought the emaciated girl from Womens Timberland 6 Inch Boots where, announced that must give the Womens Timberland Boots entire fortune he, this was also insufficient, old woman added that must cut off his all sources of income. In order to recall this absurd condition, but is working with the high graciousness astronomy, discovered All Timberland Boots that oneself likes on this enemy unexpectedly, he New Timberland Boots feels flustered to his Lovers Timberland Boots action. Unexpectedly graciousness star's side had Timberland Beach Sandals the mature perfect man handsome world, but has received Womens Timberland Roll-Top Boots US since the high school Timberland Kids Boots time's good friend to be Mens Timberland Boots also unable to own sentiment to neglect again, finally Women's Timberland Boots Snow finally with graciousness star Mens Timberland 6 Inch Boots in the same place.
longchamp

Posts: 272
Registered: 12/1/11
Longchamp
Posted: Dec 3, 2011 4:27 AM   in response to: Daniel Wiell in response to: Daniel Wiell
  Click to reply to this thread Reply
longchamp publié durante ligne au printemps 2012 sacs à major, comme l'ensemble des grandes marques, comme, Longchamp a new également tombé durante amour avec chicago couleur des bonbons. Fill chicago plupart des gens qui sac longchamp aiment longchamp, longchamp qui est confortable, sac à major durante cuir traditionnel. Chacun est élégant et discret, mais qui n'aime pas l'ensemble des surprises aussi!www.sacslongchamp-france.org
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums