views:

262

answers:

1

What I do wrong?

<map name="Aspects" table="AspectToEntity">
  <key column="EntityID" />
  <map-key column="AspectName" type="string" />
  <many-to-any id-type="long" meta-type="string">
    <column name="AspectName" />
    <column name="AspectID" />
  </many-to-any>
</map>

Exception:

Repeated column in mapping for collection: Entity.Aspects column: AspectName
A: 

You are using the same column name (AspectName) twice. Btw, what classes do you want to map? I think, the mapping file is not fully correct.

Oliver Hanappi
The mapping file is ok except <map> (if change <map> to <set> and remove <map-key> all works fine)
SHSE
Can you please tell me what classes you want to map? It would make it easier. Btw, you are right that you need to replace <map> with one of the following (not all, just samples): <bag>, <set>, <list>.
Oliver Hanappi