mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 00:55:16 +00:00
Add feature requirement for multi-insert test
This commit is contained in:
parent
6e8f344a9f
commit
2666f3f6e0
@ -50,6 +50,8 @@
|
|||||||
|
|
||||||
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 void hql_insert_example() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@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'), " +
|
||||||
|
@ -274,4 +274,10 @@ public boolean isMatch(Dialect dialect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class SupportsValuesListForInsert implements DialectCheck {
|
||||||
|
public boolean isMatch(Dialect dialect) {
|
||||||
|
return dialect.supportsValuesListForInsert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user