Add feature requirement for multi-insert test

This commit is contained in:
Christian Beikov 2022-01-04 17:38:07 +01:00
parent 6e8f344a9f
commit 2666f3f6e0
2 changed files with 10 additions and 2 deletions

View File

@ -50,6 +50,8 @@ import org.hibernate.userguide.model.WireTransferPayment;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -223,11 +225,11 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}); });
} }
@Test @SkipForDialect(SybaseDialect.class) @Test
@RequiresDialectFeature(DialectChecks.SupportsValuesListForInsert.class)
public void hql_multi_insert_example() { public void hql_multi_insert_example() {
doInJPA(this::entityManagerFactory, entityManager -> { doInJPA(this::entityManagerFactory, entityManager -> {
//tag::hql-insert-example[] //tag::hql-insert-example[]
entityManager.createQuery( entityManager.createQuery(
"insert Person (id, name) " + "insert Person (id, name) " +
"values (101L, 'J A Doe III'), " + "values (101L, 'J A Doe III'), " +

View File

@ -274,4 +274,10 @@ abstract public class DialectChecks {
} }
} }
public static class SupportsValuesListForInsert implements DialectCheck {
public boolean isMatch(Dialect dialect) {
return dialect.supportsValuesListForInsert();
}
}
} }