Get rid of column names that are problematic on H2 2.0.202+

This commit is contained in:
Christian Beikov 2022-01-06 18:26:05 +01:00
parent c284315931
commit 0fb19fd4fb
45 changed files with 111 additions and 39 deletions

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.annotations.query; package org.hibernate.orm.test.annotations.query;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -15,7 +16,8 @@ public class Attrvalue {
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@Column(name = "val")
private String value; private String value;
public Long getId() { public Long getId() {

View File

@ -123,7 +123,7 @@ public class LazyLoadingByEnhancerSetterTest extends BaseCoreFunctionalTestCase
@ElementCollection( fetch = FetchType.EAGER ) @ElementCollection( fetch = FetchType.EAGER )
@MapKeyColumn( name = "NAME" ) @MapKeyColumn( name = "NAME" )
@Lob @Lob
@Column( name = "VALUE", length = 65535 ) @Column( name = "PARAM_VAL", length = 65535 )
private Map<String, String> parameters = new HashMap<>(); private Map<String, String> parameters = new HashMap<>();
@Override @Override
@ -153,7 +153,7 @@ public class LazyLoadingByEnhancerSetterTest extends BaseCoreFunctionalTestCase
@ElementCollection( fetch = FetchType.EAGER ) @ElementCollection( fetch = FetchType.EAGER )
@MapKeyColumn( name = "NAME" ) @MapKeyColumn( name = "NAME" )
@Lob @Lob
@Column( name = "VALUE", length = 65535 ) @Column( name = "PARAM_VAL", length = 65535 )
@Override @Override
public Map<String, String> getParameters() { public Map<String, String> getParameters() {
return parameterMap; return parameterMap;

View File

@ -16,6 +16,7 @@ package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
import java.io.Serializable; import java.io.Serializable;
import jakarta.persistence.Basic; import jakarta.persistence.Basic;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.Inheritance; import jakarta.persistence.Inheritance;
@ -34,6 +35,7 @@ import org.hibernate.annotations.LazyToOneOption;
public class RoleEntity extends ModelEntity implements Serializable { public class RoleEntity extends ModelEntity implements Serializable {
@Basic @Basic
@Column(name = "val")
Short value; Short value;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)

View File

@ -45,7 +45,7 @@ public class SpecializedEntity implements Serializable {
this.id = id; this.id = id;
} }
@Column(name="Value") @Column(name="TheValue")
String value; String value;
@ManyToOne(fetch=FetchType.LAZY) @ManyToOne(fetch=FetchType.LAZY)

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.comments; package org.hibernate.orm.test.comments;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -17,6 +18,7 @@ public class TestEntity {
@Id @Id
private String id; private String id;
@Column(name = "val")
private String value; private String value;
public TestEntity() { public TestEntity() {

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.comments; package org.hibernate.orm.test.comments;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -17,6 +18,7 @@ public class TestEntity2 {
@Id @Id
private String id; private String id;
@Column(name = "val")
private String value; private String value;
public String getId() { public String getId() {

View File

@ -90,7 +90,7 @@ public class EntityLoadedInTwoPhaseLoadTest extends BaseCoreFunctionalTestCase {
@GeneratedValue @GeneratedValue
private long id; private long id;
@Column(name = "value", nullable = false) @Column(name = "val", nullable = false)
private String value; private String value;
public Finish() { public Finish() {

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.hql; package org.hibernate.orm.test.hql;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -281,6 +282,7 @@ public class CollectionMapWithComponentValueTest extends BaseCoreFunctionalTestC
@Embeddable @Embeddable
public static class EmbeddableValue { public static class EmbeddableValue {
@Column(name = "val")
Integer value; Integer value;
EmbeddableValue() { EmbeddableValue() {

View File

@ -26,6 +26,7 @@ package org.hibernate.orm.test.hql.fetchAndJoin;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@ -52,6 +53,7 @@ public class Child {
this.value = value; this.value = value;
} }
@Column(name = "val")
private String value; private String value;
public long getId() { public long getId() {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.hql.fetchAndJoin; package org.hibernate.orm.test.hql.fetchAndJoin;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -41,6 +42,7 @@ public class Entity1 {
@JoinColumn(name="entity2_id", nullable = false) @JoinColumn(name="entity2_id", nullable = false)
private Entity2 entity2; private Entity2 entity2;
@Column(name = "val")
private String value; private String value;
public long getId() { public long getId() {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.hql.fetchAndJoin; package org.hibernate.orm.test.hql.fetchAndJoin;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@ -42,6 +43,7 @@ public class Entity2 {
@JoinColumn(name="entity3_id") @JoinColumn(name="entity3_id")
private Entity3 entity3; private Entity3 entity3;
@Column(name = "val")
private String value; private String value;
public long getId() { public long getId() {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.hql.fetchAndJoin; package org.hibernate.orm.test.hql.fetchAndJoin;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -35,6 +36,7 @@ public class Entity3 {
@GeneratedValue @GeneratedValue
private long id; private long id;
@Column(name = "val")
private String value; private String value;
public long getId() { public long getId() {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.hql.fetchAndJoin; package org.hibernate.orm.test.hql.fetchAndJoin;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -35,6 +36,7 @@ public class GrandChild {
@GeneratedValue @GeneratedValue
private long id; private long id;
@Column(name = "val")
private String value; private String value;
public GrandChild() { public GrandChild() {

View File

@ -26,6 +26,7 @@ package org.hibernate.orm.test.hql.fetchAndJoin;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@ -45,6 +46,7 @@ public class Parent {
@JoinColumn @JoinColumn
private Set<Child> children = new HashSet<Child>(); private Set<Child> children = new HashSet<Child>();
@Column(name = "val")
private String value; private String value;
public Parent() { public Parent() {

View File

@ -384,6 +384,7 @@ public class OuterJoinTest {
@Column(name = "key_id") @Column(name = "key_id")
Long key; Long key;
@Column(name = "val")
String value; String value;
@ManyToOne(optional = false) @ManyToOne(optional = false)
@ -458,6 +459,7 @@ public class OuterJoinTest {
@Column(name = "key_id") @Column(name = "key_id")
private Long key; private Long key;
@Column(name = "val")
private String value; private String value;
public Association() { public Association() {

View File

@ -90,10 +90,10 @@ public class BeanValidationTest {
public void testTitleColumnHasExpectedLength(EntityManagerFactoryScope scope) { public void testTitleColumnHasExpectedLength(EntityManagerFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
entityManager -> { entityManager -> {
int len = (Integer) entityManager.createNativeQuery( Number len = (Number) entityManager.createNativeQuery(
"select CHARACTER_MAXIMUM_LENGTH from INFORMATION_SCHEMA.COLUMNS c where c.TABLE_NAME = 'CUPHOLDER' and c.COLUMN_NAME = 'TITLE'" "select CHARACTER_MAXIMUM_LENGTH from INFORMATION_SCHEMA.COLUMNS c where c.TABLE_NAME = 'CUPHOLDER' and c.COLUMN_NAME = 'TITLE'"
).getSingleResult(); ).getSingleResult();
assertEquals(64, len); assertEquals(64, len.intValue());
} }
); );
} }

View File

@ -75,7 +75,7 @@ public class TableGeneratorVisibilityTest extends BaseCoreFunctionalTestCase {
name = "table-generator", name = "table-generator",
table = "table_identifier", table = "table_identifier",
pkColumnName = "identifier", pkColumnName = "identifier",
valueColumnName = "value", valueColumnName = "val",
allocationSize = 5 allocationSize = 5
) )
public static class TestEntity3 { public static class TestEntity3 {
@ -84,7 +84,7 @@ public class TableGeneratorVisibilityTest extends BaseCoreFunctionalTestCase {
name = "table-generator-2", name = "table-generator-2",
table = "table_identifier_2", table = "table_identifier_2",
pkColumnName = "identifier", pkColumnName = "identifier",
valueColumnName = "value", valueColumnName = "val",
allocationSize = 5 allocationSize = 5
) )
@GeneratedValue(strategy = GenerationType.TABLE, generator = "table-generator") @GeneratedValue(strategy = GenerationType.TABLE, generator = "table-generator")

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.jpa.criteria.components.joins; package org.hibernate.orm.test.jpa.criteria.components.joins;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -18,6 +19,7 @@ public class ManyToOneType {
@Id @Id
@GeneratedValue @GeneratedValue
public Long id; public Long id;
@Column(name = "val")
private String value; private String value;
public ManyToOneType() { public ManyToOneType() {

View File

@ -24,6 +24,8 @@
package org.hibernate.orm.test.jpa.criteria.selectcase; package org.hibernate.orm.test.jpa.criteria.selectcase;
import java.util.List; import java.util.List;
import jakarta.persistence.Column;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
@ -124,6 +126,7 @@ public class SelectCaseTest extends BaseEntityManagerFunctionalTestCase {
private Long id; private Long id;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Column(name = "val")
private EnumValue value; private EnumValue value;
} }

View File

@ -13,6 +13,7 @@ import static org.junit.Assert.assertNull;
import java.util.List; import java.util.List;
import jakarta.persistence.AttributeConverter; import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Column;
import jakarta.persistence.Convert; import jakarta.persistence.Convert;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@ -311,6 +312,7 @@ public class BasicSimpleCaseTest extends BaseEntityManagerFunctionalTestCase {
@Convert(converter = TestEnumConverter.class) @Convert(converter = TestEnumConverter.class)
private TestEnum enumField; private TestEnum enumField;
@Column(name = "val")
private Long value; private Long value;
public long getId() { public long getId() {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.jpa.metamodel; package org.hibernate.orm.test.jpa.metamodel;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumn;
@ -39,5 +40,6 @@ public class Entity1 {
@JoinColumn(name="entity2_id", nullable = false) @JoinColumn(name="entity2_id", nullable = false)
private Entity2 entity2; private Entity2 entity2;
@Column(name = "val")
private String value; private String value;
} }

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.jpa.metamodel; package org.hibernate.orm.test.jpa.metamodel;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumn;
@ -39,5 +40,6 @@ public class Entity2 {
@JoinColumn(name="entity3_id") @JoinColumn(name="entity3_id")
private Entity3 entity3; private Entity3 entity3;
@Column(name = "val")
private String value; private String value;
} }

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.orm.test.jpa.metamodel; package org.hibernate.orm.test.jpa.metamodel;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
@ -33,5 +34,6 @@ public class Entity3 {
@Id @Id
private long id; private long id;
@Column(name = "val")
private String value; private String value;
} }

View File

@ -103,6 +103,7 @@ public class ElementCollectionTests {
* Non-serializable value type. * Non-serializable value type.
*/ */
public static class ValueType { public static class ValueType {
@Column(name = "val")
private final String value; private final String value;
public ValueType(String value) { public ValueType(String value) {
@ -155,7 +156,7 @@ public class ElementCollectionTests {
@Convert( converter = ValueTypeConverter.class ) @Convert( converter = ValueTypeConverter.class )
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "entity_set", joinColumns = @JoinColumn(name = "entity_id", nullable = false)) @CollectionTable(name = "entity_set", joinColumns = @JoinColumn(name = "entity_id", nullable = false))
@Column(name = "value", nullable = false) @Column(name = "val", nullable = false)
public Set<ValueType> set = new HashSet<ValueType>(); public Set<ValueType> set = new HashSet<ValueType>();
/** /**
@ -168,7 +169,7 @@ public class ElementCollectionTests {
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "entity_map", joinColumns = @JoinColumn(name = "entity_id", nullable = false)) @CollectionTable(name = "entity_map", joinColumns = @JoinColumn(name = "entity_id", nullable = false))
@MapKeyColumn(name = "map_key", nullable = false) @MapKeyColumn(name = "map_key", nullable = false)
@Column(name = "value", nullable = false) @Column(name = "val", nullable = false)
public Map<ValueType, ValueType> map = new HashMap<ValueType, ValueType>(); public Map<ValueType, ValueType> map = new HashMap<ValueType, ValueType>();
public TheEntity() { public TheEntity() {

View File

@ -20,7 +20,7 @@
<property name="value"> <property name="value">
<column name="value" not-null="true" /> <column name="val" not-null="true" />
</property> </property>
</class> </class>

View File

@ -27,7 +27,7 @@
<property name="author"/> <property name="author"/>
<component name="pubDate"> <component name="pubDate">
<property name="year" not-null="true" column="pubDate_year"/> <property name="year" not-null="true" column="pubDate_year"/>
<property name="month"/> <property name="month" column="pubDate_month"/>
</component> </component>
<property name="summary"/> <property name="summary"/>
<property name="totalSales" optimistic-lock="false"/> <property name="totalSales" optimistic-lock="false"/>
@ -42,7 +42,7 @@
<property name="author"/> <property name="author"/>
<component name="pubDate"> <component name="pubDate">
<property name="year" not-null="true" column="pubDate_year" /> <property name="year" not-null="true" column="pubDate_year" />
<property name="month"/> <property name="month" column="pubDate_month"/>
</component> </component>
<property name="summary"/> <property name="summary"/>
<property name="totalSales" optimistic-lock="false"/> <property name="totalSales" optimistic-lock="false"/>

View File

@ -88,7 +88,7 @@ public class Employee extends AbstractPersistent {
@ElementCollection @ElementCollection
@MapKeyColumn(name = "name", length = 180) @MapKeyColumn(name = "name", length = 180)
@Column(name = "value", nullable = false) @Column(name = "val", nullable = false)
public Map<String, String> getAnnotations() { public Map<String, String> getAnnotations() {
return this.annotations; return this.annotations;
} }

View File

@ -3,6 +3,7 @@ package org.hibernate.orm.test.query.hql;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -81,6 +82,7 @@ public class EmbeddableWithPluralAttributeTest {
@Embeddable @Embeddable
public static class B { public static class B {
@Column(name = "val")
private String value; private String value;
@OneToMany(cascade = CascadeType.ALL) @OneToMany(cascade = CascadeType.ALL)

View File

@ -110,9 +110,10 @@ public class ViewValidationTest extends BaseCoreFunctionalTestCase {
@Id @Id
private Long id; private Long id;
@Column(nullable = false) @Column(name = "the_key", nullable = false)
private String key; private String key;
@Column(name = "val")
private String value; private String value;
public Long getId() { public Long getId() {
@ -146,9 +147,10 @@ public class ViewValidationTest extends BaseCoreFunctionalTestCase {
@Id @Id
private Long id; private Long id;
@Column(nullable = false) @Column(name = "the_key", nullable = false)
private String key; private String key;
@Column(name = "val")
private String value; private String value;
public Long getId() { public Long getId() {

View File

@ -78,35 +78,35 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
session.createNativeQuery( session.createNativeQuery(
"create table COLLECTION_TABLE( " + "create table COLLECTION_TABLE( " +
"MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " + "MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " +
"VALUE varchar(10) not null, VALUE_CODE varchar(10) not null, " + "VAL varchar(10) not null, VALUE_CODE varchar(10) not null, " +
"primary key (MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE))" "primary key (MAIN_ID, MAIN_CODE, VAL, VALUE_CODE))"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'high', 'RATING' )" "VALUES( 1, 'MATERIAL', 'high', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'medium', 'RATING' )" "VALUES( 1, 'MATERIAL', 'medium', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'low', 'RATING' )" "VALUES( 1, 'MATERIAL', 'low', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'medium', 'SIZE' )" "VALUES( 1, 'MATERIAL', 'medium', 'SIZE' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'BUILDING', 'high', 'RATING' )" "VALUES( 1, 'BUILDING', 'high', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'BUILDING', 'small', 'SIZE' )" "VALUES( 1, 'BUILDING', 'small', 'SIZE' )"
).executeUpdate(); ).executeUpdate();
@ -226,7 +226,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
name = "COLLECTION_TABLE", name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) } joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
) )
@Column( name="VALUE") @Column( name="VAL")
@Where( clause = "MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'") @Where( clause = "MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'")
@Immutable @Immutable
public Set<String> getSizesFromCombined() { public Set<String> getSizesFromCombined() {
@ -283,7 +283,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
name = "COLLECTION_TABLE", name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) } joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
) )
@Column( name="VALUE") @Column( name="VAL")
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'") @Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'")
@Immutable @Immutable
public Set<String> getSizesFromCombined() { public Set<String> getSizesFromCombined() {
@ -298,7 +298,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
name = "COLLECTION_TABLE", name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) } joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
) )
@Column( name="VALUE") @Column( name="VAL")
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'" ) @Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'" )
@Immutable @Immutable
public Set<String> getRatingsFromCombined() { public Set<String> getRatingsFromCombined() {

View File

@ -15,7 +15,7 @@
<set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false" <set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
where="MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'"> where="MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'">
<key column="MAIN_ID"/> <key column="MAIN_ID"/>
<element type="string" column="VALUE"/> <element type="string" column="VAL"/>
</set> </set>
<set name="ratings" table="MATERIAL_RATINGS" lazy="true" mutable="false"> <set name="ratings" table="MATERIAL_RATINGS" lazy="true" mutable="false">
@ -35,13 +35,13 @@
<set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false" <set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
where="MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'"> where="MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'">
<key column="MAIN_ID"/> <key column="MAIN_ID"/>
<element type="string" column="VALUE"/> <element type="string" column="VAL"/>
</set> </set>
<set name="ratingsFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false" <set name="ratingsFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
where="MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'"> where="MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'">
<key column="MAIN_ID"/> <key column="MAIN_ID"/>
<element type="string" column="VALUE"/> <element type="string" column="VAL"/>
</set> </set>
</class> </class>

View File

@ -74,35 +74,35 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
session.createNativeQuery( session.createNativeQuery(
"create table COLLECTION_TABLE( " + "create table COLLECTION_TABLE( " +
"MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " + "MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " +
"VALUE varchar(10) not null, VALUE_CODE varchar(10) not null, " + "VAL varchar(10) not null, VALUE_CODE varchar(10) not null, " +
"primary key (MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE))" "primary key (MAIN_ID, MAIN_CODE, VAL, VALUE_CODE))"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'high', 'RATING' )" "VALUES( 1, 'MATERIAL', 'high', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'medium', 'RATING' )" "VALUES( 1, 'MATERIAL', 'medium', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'low', 'RATING' )" "VALUES( 1, 'MATERIAL', 'low', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'MATERIAL', 'medium', 'SIZE' )" "VALUES( 1, 'MATERIAL', 'medium', 'SIZE' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'BUILDING', 'high', 'RATING' )" "VALUES( 1, 'BUILDING', 'high', 'RATING' )"
).executeUpdate(); ).executeUpdate();
session.createNativeQuery( session.createNativeQuery(
"insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE) " + "insert into COLLECTION_TABLE(MAIN_ID, MAIN_CODE, VAL, VALUE_CODE) " +
"VALUES( 1, 'BUILDING', 'small', 'SIZE' )" "VALUES( 1, 'BUILDING', 'small', 'SIZE' )"
).executeUpdate(); ).executeUpdate();

View File

@ -12,6 +12,7 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@ -75,6 +76,7 @@ public class OrderByThreeEntityTest extends BaseEnversJPAFunctionalTestCase {
public static class Key { public static class Key {
@Id @Id
private Integer id; private Integer id;
@Column(name = "val")
private String value; private String value;
public Key() { public Key() {
@ -134,6 +136,7 @@ public class OrderByThreeEntityTest extends BaseEnversJPAFunctionalTestCase {
public static class Item { public static class Item {
@Id @Id
private Integer id; private Integer id;
@Column(name = "val")
private String value; private String value;
public Item() { public Item() {

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.envers.entities.components; package org.hibernate.orm.test.envers.entities.components;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import org.hibernate.envers.Audited; import org.hibernate.envers.Audited;
@ -17,7 +18,9 @@ import org.hibernate.envers.NotAudited;
@Embeddable @Embeddable
@Audited @Audited
public class Component4 { public class Component4 {
@Column(name = "the_key")
private String key; private String key;
@Column(name = "val")
private String value; private String value;
@NotAudited @NotAudited

View File

@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -169,6 +170,7 @@ public class ListEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -168,6 +169,7 @@ public class ListNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -11,6 +11,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -174,6 +175,7 @@ public class MapEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -171,6 +172,7 @@ public class MapNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -11,6 +11,7 @@ import java.util.HashSet;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -175,6 +176,7 @@ public class SetEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -188,6 +189,7 @@ public class SetNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
public static class Emb implements Serializable { public static class Emb implements Serializable {
@Column(name = "val")
private String value; private String value;
public Emb() { public Emb() {

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.envers.integration.naming; package org.hibernate.orm.test.envers.integration.naming;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Table; import jakarta.persistence.Table;
@ -22,6 +23,7 @@ import jakarta.persistence.Table;
public class VersionsJoinTableRangeTestEntity extends public class VersionsJoinTableRangeTestEntity extends
VersionsJoinTableRangeTestEntitySuperClass { VersionsJoinTableRangeTestEntitySuperClass {
@Column(name = "val")
private String value; private String value;
/** /**

View File

@ -11,6 +11,7 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -168,6 +169,7 @@ public abstract class AbstractEntityWithChangesQueryTest extends BaseEnversJPAFu
@GeneratedValue @GeneratedValue
private Integer id; private Integer id;
private String name; private String name;
@Column(name = "val")
private Integer value; private Integer value;
Simple() { Simple() {

View File

@ -12,6 +12,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import jakarta.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -183,6 +184,7 @@ public class ValidityAuditStrategyComponentCollectionRevEndTest extends BaseEnve
@Audited @Audited
public static class Item { public static class Item {
private String name; private String name;
@Column(name = "val")
private Integer value; private Integer value;
Item() { Item() {

View File

@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@ -228,6 +229,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
@Entity(name = "OOE") @Entity(name = "OOE")
@Audited @Audited
public static class OtherAuditedEntity extends SuperClass { public static class OtherAuditedEntity extends SuperClass {
@Column(name = "val")
private String value; private String value;
@NotAudited @NotAudited
private String notAuditedValue; private String notAuditedValue;
@ -302,6 +304,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
) )
}) })
public static class OtherOverrideAuditedEntity extends NonAuditedSuperClass { public static class OtherOverrideAuditedEntity extends NonAuditedSuperClass {
@Column(name = "val")
private String value; private String value;
@NotAudited @NotAudited
private String notAuditedValue; private String notAuditedValue;
@ -333,6 +336,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
) )
}) })
public static class OtherAuditParentsAuditEntity extends NonAuditedSuperClass { public static class OtherAuditParentsAuditEntity extends NonAuditedSuperClass {
@Column(name = "val")
private String value; private String value;
@NotAudited @NotAudited
private String notAuditedValue; private String notAuditedValue;

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.orm.test.envers.integration.superclass.auditoverride; package org.hibernate.orm.test.envers.integration.superclass.auditoverride;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable; import jakarta.persistence.Embeddable;
import jakarta.persistence.Embedded; import jakarta.persistence.Embedded;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -246,6 +247,7 @@ public class EmbeddableTest extends BaseEnversJPAFunctionalTestCase {
@Embeddable @Embeddable
@Audited @Audited
public static class AuditedEmbeddable extends SimpleAbstractMappedSuperclass { public static class AuditedEmbeddable extends SimpleAbstractMappedSuperclass {
@Column(name = "val")
private Integer value; private Integer value;
public Integer getValue() { public Integer getValue() {