Hibernate: "index" for "map" not working for me

From: Wordster (ronnie_diaz_at_hotmail.com)
Date: 01/13/05


Date: 13 Jan 2005 11:29:06 -0800

With the following mapping:

<subclass name="Card" discriminator-value="CARD">
<map name="metaNodesMap" inverse="true">
<key column="cardId"/>
<index column="associated_node_id" type="long"/>
<one-to-many class="NodeMeta"/>
</map>
</subclass>

... and the following mapping for my NodeMeta class:

<class name="NodeMeta" table="NODE_META">
<id name="id" type="long" unsaved-value="null">
<column name="NODE_META_ID" sql-type="number" not-null="true"/>
<generator class="sequence"/>
</id>
<property name="defaultExpand"/>
<many-to-one name="card" column="cardId" not-null="true"/>
</class>

The value belonging to "associated_node_id" never gets persisted to the
database.

I run the following code:

Card card = new Card();
card.setName("Test Mapping");
session.save(card);
Map metaNodesMap = card.getMetaNodesMap();
NodeMeta meta = new NodeMeta();
meta.setCard(card);
metaNodesMap.put(new Long(901), meta);
session.save(meta);
session.flush();
transaction.commit();

In the database, a "Card" row is created and a "NodeMeta" row is
created. Everything looks fine, except the "associated_node_id" in the
NodeMeta table never gets updated with the number "901". It's just
blank. When I tried to retrieve the Card instance, I get an error
saying "null index column for collection".
Does anyone know what I'm doing wrong? Thanks.
-Ronnie



Relevant Pages

  • Re: MapSource Topo 2008 downloading maps question
    ... BTW, downloading the card from eCS, I see a root directory containing all the daily track logs and a GARMIN subdirectory containing one file, GMAPSUPP.IMG. ... this file is 1527.2MB compared to MapSource's claim that my 1783 maps take up 1542.2MB of my 2GB card. ... The newer units with preloaded mapping will have their mapping in another file with a similar *.img name and it is on the root if I remember right. ...
    (sci.geo.satellite-nav)
  • Re: The ultimate luxury ?
    ... > teach the kids about sorting on sub-fields. ... > examines a piece of the data contained in each card. ... > Merging takes two card decks and makes one card deck based ... That mapping may or may not be created by lifting a mapping ...
    (sci.physics)
  • RE: MVCIN instruction
    ... > And a 2501 which was an Unbuffered Card Reader ... > Image mapping to Internal mapping. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: MVCIN instruction
    ... the programs would issue a Read Column Binary/No-Stacker-Select to get the 160 Column Binary Bytes followed by a Read EBCDIC/Stacker-Select/Data-Check-Off. ... Since you only got on crack at the card with the 2501, they had to be read as Column Binary and then have the EBCDIC columns converted from the internal version of Card Image to the real internal EBCDIC mappings. ... This was done with a sequence of TRs followed by a OC and a final TR to do the actual conversion from the Card Punch Image mapping to Internal mapping. ...
    (bit.listserv.ibm-main)