The issue due to a combination of a Map as an association, a mappedBy property, and a @MapKeyColumn annotation, as shown below: @OneToMany( mappedBy="owner", fetch=FetchType.EAGER, cascade=CascadeType.ALL) @MapKeyColumn(name="phone_type", table="Phone") private Map<String, Phone> phones; These annotations are describing two tables, Person, and Phone. It is asking for the Map key (the String), to be placed in the Phone table. This setup will work unless the MapKeyColumn attempts to specify a name for the column. When the application is run, the column will be created as "phone_type" as specified, instead of the "phone_KEY" default, but when an insert is attempted, then a "NULL not allowed for column "PHONE_TYPE"; SQL statement:" exception will be generated. One sort of workaround is to make the "phones" association a List<Phone> instead of a map, and put a "phone_type" field in the Phone entity. Person and Phone test Entities attached. |