HHH-10036 - Fix identifier is too long exception for test MapKeyCustomEnumTypeTest

This commit is contained in:
Andrea Boriero 2015-08-18 14:13:05 +01:00
parent 6191489ca3
commit a9daa65c12
2 changed files with 8 additions and 1 deletions

View File

@ -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<LastNumber, String> lastNumberMap = new HashMap<LastNumber, String>();
@MapKeyEnumerated(EnumType.STRING)
@ElementCollection
@CollectionTable(name = "overridingMap")
@MapKeyColumn(name = "overridingMap_key")
Map<LastNumber, String> explicitOverridingImplicitMap = new HashMap<LastNumber, String>();
}

View File

@ -187,7 +187,7 @@ public class MapKeyCustomEnumTypeTest extends BaseNonConfigCoreFunctionalTestCas
"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 );