Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-3455

Some tests fails because oracle12c doesn't support single column identity table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.6.CR1, 7.0.6.GA
    • 7.0.0.ER5
    • Hibernate
    • None
    • EAP 7.0.6

      Some tests fails on oracle when entity has no columns except identity one

      MapKeyAttributeConverterTest.java#L239

      @Entity
      @Table(name = "map_entity")
      public static class MapEntity {
      	@Id
      	@GeneratedValue(strategy = GenerationType.IDENTITY)
      	private Integer id;
      	
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "implicitType")
      	private Map<ColorType, MapValue> implicitType = new HashMap<ColorType, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "explicitType")
      	private Map<ColorType, MapValue> explicitType = new HashMap<ColorType, MapValue>();
      
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumDefault")
      	private Map<EnumMapKey, MapValue> enumDefaultType = new HashMap<EnumMapKey, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumExplicitOrdinal")
      	private Map<EnumMapKey, MapValue> enumExplicitOrdinalType = new HashMap<EnumMapKey, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumExplicitString")
      	private Map<EnumMapKey, MapValue> enumExplicitStringType = new HashMap<EnumMapKey, MapValue>();
      
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumExplicit")
      	private Map<EnumMapKey, MapValue> enumExplicitType = new HashMap<EnumMapKey, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumImplicit")
      	private Map<ImplicitEnumMapKey, MapValue> enumImplicitType = new HashMap<ImplicitEnumMapKey, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumImplicitOverrideOrdinal")
      	private Map<ImplicitEnumMapKey, MapValue> enumImplicitOverrideOrdinalType = new HashMap<ImplicitEnumMapKey, MapValue>();
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumImplicitOverrideString")
      	private Map<ImplicitEnumMapKey, MapValue> enumImplicitOverrideStringType = new HashMap<ImplicitEnumMapKey, MapValue>();
      
      	@OneToMany(mappedBy = "mapEntity", cascade = CascadeType.ALL)
      	@MapKey(name = "enumImplicitOverrided")
      	private Map<ImplicitEnumMapKey, MapValue> enumImplicitOverridedType = new HashMap<ImplicitEnumMapKey, MapValue>();
      }
      

      generates INSERT statement

      insert into map_entity values ( )
      

      which fails on Oracle12c with ORA-00936: missing expression. The same SQL passes on Sybase. MS SQL Server has different SQL insert into map_entity default values.

      At least these tests are affected:
      org.hibernate.test.converter.map.MapKeyAttributeConverterTest

      • could be changed to use GenerationType.AUTO
      • or added column to entity (the @RequiresDialectFeature should be added)

      org.hibernate.id.FlushIdGenTest

      Workaround is to add some column to entity

      @Column
      private String foo = "bar";
      

              gbadner@redhat.com Gail Badner (Inactive)
              msimka@redhat.com Martin Simka
              Martin Simka Martin Simka
              Martin Simka Martin Simka
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: