diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/EntityMapEnum.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/EntityMapEnum.java index 4e0410535d..4210a02a45 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/EntityMapEnum.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/EntityMapEnum.java @@ -6,11 +6,16 @@ */ package org.hibernate.test.annotations.enumerated.custom_mapkey; +import javax.persistence.CollectionTable; +import javax.persistence.Column; import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.EnumType; +import javax.persistence.ForeignKey; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.MapKeyColumn; import javax.persistence.MapKeyEnumerated; import java.util.HashMap; import java.util.Map; @@ -47,5 +52,7 @@ public class EntityMapEnum { Map lastNumberMap = new HashMap(); @MapKeyEnumerated(EnumType.STRING) @ElementCollection + @CollectionTable(name = "overridingMap") + @MapKeyColumn(name = "overridingMap_key") Map explicitOverridingImplicitMap = new HashMap(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/MapKeyCustomEnumTypeTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/MapKeyCustomEnumTypeTest.java index b60169a4c2..5d17d2989b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/MapKeyCustomEnumTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/enumerated/custom_mapkey/MapKeyCustomEnumTypeTest.java @@ -187,7 +187,7 @@ public void testQuery() { "from EntityMapEnum ee where key(ee.explicitOverridingImplicitMap)='NUMBER_2'", "from EntityMapEnum ee where key(ee.explicitOverridingImplicitMap)=:param", LastNumber.NUMBER_2, - "select 1 from EntityMapEnum_explicitOverridingImplicitMap where EntityMapEnum_id=:idEntityMapEnum and explicitOverridingImplicitMap_KEY='NUMBER_2'" + "select 1 from overridingMap where EntityMapEnum_id=:idEntityMapEnum and overridingMap_key='NUMBER_2'" ); assertFalse( found.explicitOverridingImplicitMap.isEmpty() ); delete( id );