The examples I have run over all have the column used as a MapKey as a part of the mapped element, and it seems you have to set the key explicitly in the value object.
The annotation pattern seems to be that the column mentioned by MapKey should also be a @Basic in the mapped object.
I think I possibly may have misinterpreted something. Isn't it possible to go
Code:
Map myMap = new HashMap();
myMap.put("key", myMappedObject);
myObject.setMap(myMap);
session.save(myObject)
and have the EJB3 engine persist "key" without explicitly setting the associated property in the mapped object?