1). Basically the <key column="ID"> allows hibernate to find all the Feature instances in the map of a particular instance of vehicle. The <map-key column="KEY' type="integer"> is the key within the map that a particular instance of Feature is stored under. So you do need both.
I can think of 2 possible solutions.
1). Create a second getter and setter for the EnumMap attribute using a new name. The second getter would take the existing EnumMap and create a normal old map with Integers as keys and FeatureType as the value and return it. The second setter would accept a normal map and convert it to a EnumMap. Now you use this now propety for the mapping and map it as a normal Map.
2). The second option is a UserType. A UserType is a class you can name in a mapping document as the type for a property. The user type isn't the type for property as declared in the class. Instead it's a class that knows how to help Hibernate store the property in the database.
As you can see below I have a class with a property called name that is of a custom user developed type. Hibernate doesn't know how to store this in the database. So I create another class called a UserType that does know and I name it in the mapping document.
I've only done some very basic UserTypes so I can't really give you much help. What little I do know I've learned from studying the examples. If your in a hurry option is the way to go. Though you might want to learn something about UserTypes since they do allow you to handle some issues like this more elegantly.
Code:
<property column="NAME" name="name" type="com.company.SomeUserType" not-null="true" >
Code:
public class Example {
private FancyType name;
public FancyType getName() {
return(name);
}
}