Fix tests faiiling on Jenkins
This commit is contained in:
parent
bd4908449f
commit
0b046885c5
|
@ -62,17 +62,34 @@ public class BitSetUserTypeTest extends BaseCoreFunctionalTestCase {
|
|||
Product product = session.get( Product.class, 1 );
|
||||
assertEquals(bitSet, product.getBitSet());
|
||||
} );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNativeQuery() {
|
||||
BitSet bitSet = BitSet.valueOf( new long[] {1, 2, 3} );
|
||||
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
Product product = new Product( );
|
||||
product.setId( 1 );
|
||||
product.setBitSet( bitSet );
|
||||
session.persist( product );
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
Product product = (Product) session.getNamedNativeQuery(
|
||||
"find_person_by_bitset")
|
||||
.setParameter( "id", 1L)
|
||||
.getSingleResult();
|
||||
"find_person_by_bitset")
|
||||
.setParameter( "id", 1L)
|
||||
.getSingleResult();
|
||||
|
||||
assertEquals(bitSet, product.getBitSet());
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCleanupTestDataRequired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@NamedNativeQuery(
|
||||
name = "find_person_by_bitset",
|
||||
query =
|
||||
|
@ -88,8 +105,8 @@ public class BitSetUserTypeTest extends BaseCoreFunctionalTestCase {
|
|||
classes = @ConstructorResult(
|
||||
targetClass = Product.class,
|
||||
columns = {
|
||||
@ColumnResult(name = "id"),
|
||||
@ColumnResult(name = "bitset", type = BitSetUserType.class)
|
||||
@ColumnResult(name = "pr.id"),
|
||||
@ColumnResult(name = "pr.bitset", type = BitSetUserType.class)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue