HHH-13011 Fix the tests: use int column in where clause

This commit is contained in:
Gail Badner 2018-10-16 14:17:04 -07:00
parent 66d9859813
commit a09e6156f9
21 changed files with 51 additions and 52 deletions

View File

@ -83,7 +83,7 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
session -> {
Category c = session.get( Category.class, category.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -131,7 +131,7 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
@GeneratedValue
@ -139,7 +139,7 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
private String name;
private boolean inactive;
private int inactive;
}
@Embeddable

View File

@ -82,7 +82,7 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
session -> {
Category c = session.get( Category.class, category.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -130,7 +130,7 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
@GeneratedValue
@ -138,7 +138,7 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
private String name;
private boolean inactive;
private int inactive;
}
@Embeddable

View File

@ -127,7 +127,7 @@ public class EagerToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunc
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -186,7 +186,7 @@ public class EagerToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunc
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -199,7 +199,7 @@ public class EagerToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunc
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -208,6 +208,6 @@ public class EagerToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunc
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -24,7 +24,6 @@ import org.hibernate.annotations.WhereJoinTable;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.After;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
@ -122,7 +121,7 @@ public class EagerToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -181,7 +180,7 @@ public class EagerToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -194,7 +193,7 @@ public class EagerToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -203,6 +202,6 @@ public class EagerToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -127,7 +127,7 @@ public class EagerToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunction
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -186,7 +186,7 @@ public class EagerToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunction
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -199,7 +199,7 @@ public class EagerToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunction
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -208,6 +208,6 @@ public class EagerToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunction
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -127,7 +127,7 @@ public class LazyToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunct
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -186,7 +186,7 @@ public class LazyToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunct
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -199,7 +199,7 @@ public class LazyToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunct
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -208,6 +208,6 @@ public class LazyToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunct
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -121,7 +121,7 @@ public class LazyToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -180,7 +180,7 @@ public class LazyToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -193,7 +193,7 @@ public class LazyToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -202,6 +202,6 @@ public class LazyToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -127,7 +127,7 @@ public class LazyToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunctiona
session -> {
Category c = session.get( Category.class, flowers.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -186,7 +186,7 @@ public class LazyToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunctiona
private Set<Category> categoriesManyToMany = new HashSet<>();
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "categoriesWithDescManyToMany")
@JoinTable(name = "categoriesWithDescManyToMany", inverseJoinColumns = { @JoinColumn( name = "categoryId" )})
@Where( clause = "description is not null" )
private Set<Category> categoriesWithDescManyToMany = new HashSet<>();
@ -199,7 +199,7 @@ public class LazyToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunctiona
@Entity(name = "Category")
@Table(name = "CATEGORY")
@Where(clause = "not inactive")
@Where(clause = "inactive = 0")
public static class Category {
@Id
private int id;
@ -208,6 +208,6 @@ public class LazyToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunctiona
private String description;
private boolean inactive;
private int inactive;
}
}

View File

@ -13,7 +13,7 @@ public class Category {
private String description;
private boolean inactive;
private int inactive;
public int getId() {
return id;
@ -39,11 +39,11 @@ public class Category {
this.description = description;
}
public boolean isInactive() {
public int getInactive() {
return inactive;
}
public void setInactive(boolean inactive) {
public void setInactive(int inactive) {
this.inactive = inactive;
}
}

View File

@ -28,7 +28,7 @@
</class>
<class name="EagerManyToOneFetchModeJoinWhereTest$Category" table="CATEGORY" where="not inactive">
<class name="EagerManyToOneFetchModeJoinWhereTest$Category" table="CATEGORY" where="inactive = 0">
<id name="id" column="ID">
<generator class="increment" />
</id>

View File

@ -66,7 +66,7 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
session -> {
Category c = session.get( Category.class, category.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -141,7 +141,7 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
private String name;
private boolean inactive;
private int inactive;
public int getId() {
return id;
@ -159,11 +159,11 @@ public class EagerManyToOneFetchModeJoinWhereTest extends BaseNonConfigCoreFunct
this.name = name;
}
public boolean isInactive() {
public int getInactive() {
return inactive;
}
public void setInactive(boolean inactive) {
public void setInactive(int inactive) {
this.inactive = inactive;
}
}

View File

@ -28,7 +28,7 @@
</class>
<class name="EagerManyToOneFetchModeSelectWhereTest$Category" table="CATEGORY" where="not inactive">
<class name="EagerManyToOneFetchModeSelectWhereTest$Category" table="CATEGORY" where="inactive = 0">
<id name="id" column="ID">
<generator class="increment" />
</id>

View File

@ -64,7 +64,7 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
session -> {
Category c = session.get( Category.class, category.id );
assertNotNull( c );
c.inactive = true;
c.inactive = 1;
}
);
@ -139,7 +139,7 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
private String name;
private boolean inactive;
private int inactive;
public int getId() {
return id;
@ -157,11 +157,11 @@ public class EagerManyToOneFetchModeSelectWhereTest extends BaseNonConfigCoreFun
this.name = name;
}
public boolean isInactive() {
public int getInactive() {
return inactive;
}
public void setInactive(boolean inactive) {
public void setInactive(int inactive) {
this.inactive = inactive;
}
}

View File

@ -39,7 +39,7 @@
</class>
<class name="Category" table="CATEGORY" where="not inactive">
<class name="Category" table="CATEGORY" where="inactive = 0">
<id name="id" column="ID"/>
<property name="name"/>

View File

@ -116,7 +116,7 @@ public class EagerToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunc
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);

View File

@ -109,7 +109,7 @@ public class EagerToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);

View File

@ -116,7 +116,7 @@ public class EagerToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunction
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);

View File

@ -39,7 +39,7 @@
</class>
<class name="Category" table="CATEGORY" where="not inactive">
<class name="Category" table="CATEGORY" where="inactive = 0">
<id name="id" column="ID"/>
<property name="name"/>

View File

@ -116,7 +116,7 @@ public class LazyToManyWhereDontUseClassWhereTest extends BaseNonConfigCoreFunct
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);

View File

@ -109,7 +109,7 @@ public class LazyToManyWhereTest extends BaseNonConfigCoreFunctionalTestCase {
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);

View File

@ -116,7 +116,7 @@ public class LazyToManyWhereUseClassWhereTest extends BaseNonConfigCoreFunctiona
session -> {
Category c = session.get( Category.class, flowers.getId() );
assertNotNull( c );
c.setInactive( true );
c.setInactive( 1 );
}
);