Get rid of column names that are problematic on H2 2.0.202+
This commit is contained in:
parent
c284315931
commit
0fb19fd4fb
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.annotations.query;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -15,7 +16,8 @@ public class Attrvalue {
|
|||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
|
|
|
@ -123,7 +123,7 @@ public class LazyLoadingByEnhancerSetterTest extends BaseCoreFunctionalTestCase
|
|||
@ElementCollection( fetch = FetchType.EAGER )
|
||||
@MapKeyColumn( name = "NAME" )
|
||||
@Lob
|
||||
@Column( name = "VALUE", length = 65535 )
|
||||
@Column( name = "PARAM_VAL", length = 65535 )
|
||||
private Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
@Override
|
||||
|
@ -153,7 +153,7 @@ public class LazyLoadingByEnhancerSetterTest extends BaseCoreFunctionalTestCase
|
|||
@ElementCollection( fetch = FetchType.EAGER )
|
||||
@MapKeyColumn( name = "NAME" )
|
||||
@Lob
|
||||
@Column( name = "VALUE", length = 65535 )
|
||||
@Column( name = "PARAM_VAL", length = 65535 )
|
||||
@Override
|
||||
public Map<String, String> getParameters() {
|
||||
return parameterMap;
|
||||
|
|
|
@ -16,6 +16,7 @@ package org.hibernate.orm.test.bytecode.enhancement.lazy.proxy;
|
|||
|
||||
import java.io.Serializable;
|
||||
import jakarta.persistence.Basic;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.Inheritance;
|
||||
|
@ -34,6 +35,7 @@ import org.hibernate.annotations.LazyToOneOption;
|
|||
public class RoleEntity extends ModelEntity implements Serializable {
|
||||
|
||||
@Basic
|
||||
@Column(name = "val")
|
||||
Short value;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
|
|
|
@ -45,7 +45,7 @@ public class SpecializedEntity implements Serializable {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@Column(name="Value")
|
||||
@Column(name="TheValue")
|
||||
String value;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.comments;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
|
@ -17,6 +18,7 @@ public class TestEntity {
|
|||
@Id
|
||||
private String id;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public TestEntity() {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.comments;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
|
@ -17,6 +18,7 @@ public class TestEntity2 {
|
|||
@Id
|
||||
private String id;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -90,7 +90,7 @@ public class EntityLoadedInTwoPhaseLoadTest extends BaseCoreFunctionalTestCase {
|
|||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
@Column(name = "value", nullable = false)
|
||||
@Column(name = "val", nullable = false)
|
||||
private String value;
|
||||
|
||||
public Finish() {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.hql;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -281,6 +282,7 @@ public class CollectionMapWithComponentValueTest extends BaseCoreFunctionalTestC
|
|||
|
||||
@Embeddable
|
||||
public static class EmbeddableValue {
|
||||
@Column(name = "val")
|
||||
Integer value;
|
||||
|
||||
EmbeddableValue() {
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.orm.test.hql.fetchAndJoin;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
|
@ -52,6 +53,7 @@ public class Child {
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public long getId() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.hql.fetchAndJoin;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -41,6 +42,7 @@ public class Entity1 {
|
|||
@JoinColumn(name="entity2_id", nullable = false)
|
||||
private Entity2 entity2;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public long getId() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.hql.fetchAndJoin;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
|
@ -42,6 +43,7 @@ public class Entity2 {
|
|||
@JoinColumn(name="entity3_id")
|
||||
private Entity3 entity3;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public long getId() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.hql.fetchAndJoin;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -35,6 +36,7 @@ public class Entity3 {
|
|||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public long getId() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.hql.fetchAndJoin;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -35,6 +36,7 @@ public class GrandChild {
|
|||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public GrandChild() {
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.orm.test.hql.fetchAndJoin;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
|
@ -45,6 +46,7 @@ public class Parent {
|
|||
@JoinColumn
|
||||
private Set<Child> children = new HashSet<Child>();
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Parent() {
|
||||
|
|
|
@ -384,6 +384,7 @@ public class OuterJoinTest {
|
|||
@Column(name = "key_id")
|
||||
Long key;
|
||||
|
||||
@Column(name = "val")
|
||||
String value;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
|
@ -458,6 +459,7 @@ public class OuterJoinTest {
|
|||
@Column(name = "key_id")
|
||||
private Long key;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Association() {
|
||||
|
|
|
@ -90,10 +90,10 @@ public class BeanValidationTest {
|
|||
public void testTitleColumnHasExpectedLength(EntityManagerFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
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'"
|
||||
).getSingleResult();
|
||||
assertEquals(64, len);
|
||||
assertEquals(64, len.intValue());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TableGeneratorVisibilityTest extends BaseCoreFunctionalTestCase {
|
|||
name = "table-generator",
|
||||
table = "table_identifier",
|
||||
pkColumnName = "identifier",
|
||||
valueColumnName = "value",
|
||||
valueColumnName = "val",
|
||||
allocationSize = 5
|
||||
)
|
||||
public static class TestEntity3 {
|
||||
|
@ -84,7 +84,7 @@ public class TableGeneratorVisibilityTest extends BaseCoreFunctionalTestCase {
|
|||
name = "table-generator-2",
|
||||
table = "table_identifier_2",
|
||||
pkColumnName = "identifier",
|
||||
valueColumnName = "value",
|
||||
valueColumnName = "val",
|
||||
allocationSize = 5
|
||||
)
|
||||
@GeneratedValue(strategy = GenerationType.TABLE, generator = "table-generator")
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.jpa.criteria.components.joins;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -18,6 +19,7 @@ public class ManyToOneType {
|
|||
@Id
|
||||
@GeneratedValue
|
||||
public Long id;
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public ManyToOneType() {
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
package org.hibernate.orm.test.jpa.criteria.selectcase;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
|
@ -124,6 +126,7 @@ public class SelectCaseTest extends BaseEntityManagerFunctionalTestCase {
|
|||
private Long id;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "val")
|
||||
private EnumValue value;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import static org.junit.Assert.assertNull;
|
|||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Convert;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
@ -311,6 +312,7 @@ public class BasicSimpleCaseTest extends BaseEntityManagerFunctionalTestCase {
|
|||
@Convert(converter = TestEnumConverter.class)
|
||||
private TestEnum enumField;
|
||||
|
||||
@Column(name = "val")
|
||||
private Long value;
|
||||
|
||||
public long getId() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.jpa.metamodel;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
|
@ -39,5 +40,6 @@ public class Entity1 {
|
|||
@JoinColumn(name="entity2_id", nullable = false)
|
||||
private Entity2 entity2;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.jpa.metamodel;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
|
@ -39,5 +40,6 @@ public class Entity2 {
|
|||
@JoinColumn(name="entity3_id")
|
||||
private Entity3 entity3;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.jpa.metamodel;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
@ -33,5 +34,6 @@ public class Entity3 {
|
|||
@Id
|
||||
private long id;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
}
|
||||
|
|
|
@ -103,6 +103,7 @@ public class ElementCollectionTests {
|
|||
* Non-serializable value type.
|
||||
*/
|
||||
public static class ValueType {
|
||||
@Column(name = "val")
|
||||
private final String value;
|
||||
|
||||
public ValueType(String value) {
|
||||
|
@ -155,7 +156,7 @@ public class ElementCollectionTests {
|
|||
@Convert( converter = ValueTypeConverter.class )
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
@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>();
|
||||
|
||||
/**
|
||||
|
@ -168,7 +169,7 @@ public class ElementCollectionTests {
|
|||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
@CollectionTable(name = "entity_map", joinColumns = @JoinColumn(name = "entity_id", 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 TheEntity() {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
|
||||
<property name="value">
|
||||
<column name="value" not-null="true" />
|
||||
<column name="val" not-null="true" />
|
||||
</property>
|
||||
</class>
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<property name="author"/>
|
||||
<component name="pubDate">
|
||||
<property name="year" not-null="true" column="pubDate_year"/>
|
||||
<property name="month"/>
|
||||
<property name="month" column="pubDate_month"/>
|
||||
</component>
|
||||
<property name="summary"/>
|
||||
<property name="totalSales" optimistic-lock="false"/>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<property name="author"/>
|
||||
<component name="pubDate">
|
||||
<property name="year" not-null="true" column="pubDate_year" />
|
||||
<property name="month"/>
|
||||
<property name="month" column="pubDate_month"/>
|
||||
</component>
|
||||
<property name="summary"/>
|
||||
<property name="totalSales" optimistic-lock="false"/>
|
||||
|
|
|
@ -88,7 +88,7 @@ public class Employee extends AbstractPersistent {
|
|||
|
||||
@ElementCollection
|
||||
@MapKeyColumn(name = "name", length = 180)
|
||||
@Column(name = "value", nullable = false)
|
||||
@Column(name = "val", nullable = false)
|
||||
public Map<String, String> getAnnotations() {
|
||||
return this.annotations;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.hibernate.orm.test.query.hql;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -81,6 +82,7 @@ public class EmbeddableWithPluralAttributeTest {
|
|||
|
||||
@Embeddable
|
||||
public static class B {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL)
|
||||
|
|
|
@ -110,9 +110,10 @@ public class ViewValidationTest extends BaseCoreFunctionalTestCase {
|
|||
@Id
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@Column(name = "the_key", nullable = false)
|
||||
private String key;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
|
@ -146,9 +147,10 @@ public class ViewValidationTest extends BaseCoreFunctionalTestCase {
|
|||
@Id
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@Column(name = "the_key", nullable = false)
|
||||
private String key;
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
|
|
|
@ -78,35 +78,35 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
|
|||
session.createNativeQuery(
|
||||
"create table COLLECTION_TABLE( " +
|
||||
"MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " +
|
||||
"VALUE varchar(10) not null, VALUE_CODE varchar(10) not null, " +
|
||||
"primary key (MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE))"
|
||||
"VAL varchar(10) not null, VALUE_CODE varchar(10) not null, " +
|
||||
"primary key (MAIN_ID, MAIN_CODE, VAL, VALUE_CODE))"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
|
@ -226,7 +226,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
|
|||
name = "COLLECTION_TABLE",
|
||||
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
|
||||
)
|
||||
@Column( name="VALUE")
|
||||
@Column( name="VAL")
|
||||
@Where( clause = "MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'")
|
||||
@Immutable
|
||||
public Set<String> getSizesFromCombined() {
|
||||
|
@ -283,7 +283,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
|
|||
name = "COLLECTION_TABLE",
|
||||
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
|
||||
)
|
||||
@Column( name="VALUE")
|
||||
@Column( name="VAL")
|
||||
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'")
|
||||
@Immutable
|
||||
public Set<String> getSizesFromCombined() {
|
||||
|
@ -298,7 +298,7 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
|
|||
name = "COLLECTION_TABLE",
|
||||
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
|
||||
)
|
||||
@Column( name="VALUE")
|
||||
@Column( name="VAL")
|
||||
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'" )
|
||||
@Immutable
|
||||
public Set<String> getRatingsFromCombined() {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
|
||||
where="MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'">
|
||||
<key column="MAIN_ID"/>
|
||||
<element type="string" column="VALUE"/>
|
||||
<element type="string" column="VAL"/>
|
||||
</set>
|
||||
|
||||
<set name="ratings" table="MATERIAL_RATINGS" lazy="true" mutable="false">
|
||||
|
@ -35,13 +35,13 @@
|
|||
<set name="sizesFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
|
||||
where="MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'">
|
||||
<key column="MAIN_ID"/>
|
||||
<element type="string" column="VALUE"/>
|
||||
<element type="string" column="VAL"/>
|
||||
</set>
|
||||
|
||||
<set name="ratingsFromCombined" table="COLLECTION_TABLE" lazy="true" mutable="false"
|
||||
where="MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'">
|
||||
<key column="MAIN_ID"/>
|
||||
<element type="string" column="VALUE"/>
|
||||
<element type="string" column="VAL"/>
|
||||
</set>
|
||||
|
||||
</class>
|
||||
|
|
|
@ -74,35 +74,35 @@ public class LazyElementCollectionBasicNonUniqueIdWhereTest extends BaseCoreFunc
|
|||
session.createNativeQuery(
|
||||
"create table COLLECTION_TABLE( " +
|
||||
"MAIN_ID integer not null, MAIN_CODE varchar(10) not null, " +
|
||||
"VALUE varchar(10) not null, VALUE_CODE varchar(10) not null, " +
|
||||
"primary key (MAIN_ID, MAIN_CODE, VALUE, VALUE_CODE))"
|
||||
"VAL varchar(10) not null, VALUE_CODE varchar(10) not null, " +
|
||||
"primary key (MAIN_ID, MAIN_CODE, VAL, VALUE_CODE))"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
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' )"
|
||||
).executeUpdate();
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.Iterator;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
|
@ -75,6 +76,7 @@ public class OrderByThreeEntityTest extends BaseEnversJPAFunctionalTestCase {
|
|||
public static class Key {
|
||||
@Id
|
||||
private Integer id;
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Key() {
|
||||
|
@ -134,6 +136,7 @@ public class OrderByThreeEntityTest extends BaseEnversJPAFunctionalTestCase {
|
|||
public static class Item {
|
||||
@Id
|
||||
private Integer id;
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Item() {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.envers.entities.components;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
|
@ -17,7 +18,9 @@ import org.hibernate.envers.NotAudited;
|
|||
@Embeddable
|
||||
@Audited
|
||||
public class Component4 {
|
||||
@Column(name = "the_key")
|
||||
private String key;
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
@NotAudited
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -169,6 +170,7 @@ public class ListEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -168,6 +169,7 @@ public class ListNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -174,6 +175,7 @@ public class MapEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.Serializable;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -171,6 +172,7 @@ public class MapNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.HashSet;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -175,6 +176,7 @@ public class SetEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.Serializable;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -188,6 +189,7 @@ public class SetNoEqualsHashCodeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
|
||||
@Embeddable
|
||||
public static class Emb implements Serializable {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
public Emb() {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.envers.integration.naming;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
|
@ -22,6 +23,7 @@ import jakarta.persistence.Table;
|
|||
public class VersionsJoinTableRangeTestEntity extends
|
||||
VersionsJoinTableRangeTestEntitySuperClass {
|
||||
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -168,6 +169,7 @@ public abstract class AbstractEntityWithChangesQueryTest extends BaseEnversJPAFu
|
|||
@GeneratedValue
|
||||
private Integer id;
|
||||
private String name;
|
||||
@Column(name = "val")
|
||||
private Integer value;
|
||||
|
||||
Simple() {
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import jakarta.persistence.CollectionTable;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -183,6 +184,7 @@ public class ValidityAuditStrategyComponentCollectionRevEndTest extends BaseEnve
|
|||
@Audited
|
||||
public static class Item {
|
||||
private String name;
|
||||
@Column(name = "val")
|
||||
private Integer value;
|
||||
|
||||
Item() {
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
@ -228,6 +229,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
|
|||
@Entity(name = "OOE")
|
||||
@Audited
|
||||
public static class OtherAuditedEntity extends SuperClass {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
@NotAudited
|
||||
private String notAuditedValue;
|
||||
|
@ -302,6 +304,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
|
|||
)
|
||||
})
|
||||
public static class OtherOverrideAuditedEntity extends NonAuditedSuperClass {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
@NotAudited
|
||||
private String notAuditedValue;
|
||||
|
@ -333,6 +336,7 @@ public class AuditOverrideAuditJoinTableTest extends BaseEnversJPAFunctionalTest
|
|||
)
|
||||
})
|
||||
public static class OtherAuditParentsAuditEntity extends NonAuditedSuperClass {
|
||||
@Column(name = "val")
|
||||
private String value;
|
||||
@NotAudited
|
||||
private String notAuditedValue;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.envers.integration.superclass.auditoverride;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Embedded;
|
||||
import jakarta.persistence.Entity;
|
||||
|
@ -246,6 +247,7 @@ public class EmbeddableTest extends BaseEnversJPAFunctionalTestCase {
|
|||
@Embeddable
|
||||
@Audited
|
||||
public static class AuditedEmbeddable extends SimpleAbstractMappedSuperclass {
|
||||
@Column(name = "val")
|
||||
private Integer value;
|
||||
|
||||
public Integer getValue() {
|
||||
|
|
Loading…
Reference in New Issue