.
+ */
+package org.hibernate.hql.spi.id.inline;
+
+import org.hibernate.boot.spi.MetadataImplementor;
+import org.hibernate.boot.spi.SessionFactoryOptions;
+import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
+import org.hibernate.engine.jdbc.spi.JdbcServices;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.hql.internal.ast.HqlSqlWalker;
+import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
+
+/**
+ * This bulk-id strategy inlines identifiers of the rows that need to be updated or deleted in a subselect using a VALUES list:
+ *
+ *
+ * delete
+ * from
+ * Person
+ * where
+ * ( id ) in (
+ * select
+ * id
+ * from (
+ * values
+ * ( 1 ),
+ * ( 2 ),
+ * ( 3 ),
+ * ( 4 )
+ * ) as HT (id)
+ * )
+ *
+ *
+ * @author Vlad Mihalcea
+ */
+public class InlineIdsSubSelectValueListBulkIdStrategy
+ implements MultiTableBulkIdStrategy {
+
+ public static final InlineIdsSubSelectValueListBulkIdStrategy INSTANCE =
+ new InlineIdsSubSelectValueListBulkIdStrategy();
+
+ @Override
+ public void prepare(
+ JdbcServices jdbcServices,
+ JdbcConnectionAccess jdbcConnectionAccess,
+ MetadataImplementor metadataImplementor,
+ SessionFactoryOptions sessionFactoryOptions) {
+ // nothing to do
+ }
+
+ @Override
+ public void release(
+ JdbcServices jdbcServices,
+ JdbcConnectionAccess connectionAccess) {
+ // nothing to do
+ }
+
+ @Override
+ public UpdateHandler buildUpdateHandler(
+ SessionFactoryImplementor factory,
+ HqlSqlWalker walker) {
+ return new InlineIdsSubSelectValuesListUpdateHandlerImpl(
+ factory,
+ walker
+ );
+ }
+
+ @Override
+ public DeleteHandler buildDeleteHandler(
+ SessionFactoryImplementor factory,
+ HqlSqlWalker walker) {
+ return new InlineIdsSubSelectValuesListDeleteHandlerImpl(
+ factory,
+ walker
+ );
+ }
+
+}
diff --git a/hibernate-core/src/main/java/org/hibernate/hql/spi/id/inline/InlineIdsSubSelectValuesListBuilder.java b/hibernate-core/src/main/java/org/hibernate/hql/spi/id/inline/InlineIdsSubSelectValuesListBuilder.java
new file mode 100644
index 0000000000..46c8589fd7
--- /dev/null
+++ b/hibernate-core/src/main/java/org/hibernate/hql/spi/id/inline/InlineIdsSubSelectValuesListBuilder.java
@@ -0,0 +1,49 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
+ * See the lgpl.txt file in the root directory or .
+ */
+package org.hibernate.hql.spi.id.inline;
+
+import java.util.List;
+
+import org.hibernate.dialect.Dialect;
+import org.hibernate.type.Type;
+import org.hibernate.type.TypeResolver;
+
+/**
+ * Builds the where SELECT FROM VALUES clause that wraps the identifiers to be updated/deleted.
+ *
+ * @author Vlad Mihalcea
+ */
+public class InlineIdsSubSelectValuesListBuilder extends IdsClauseBuilder {
+
+ public InlineIdsSubSelectValuesListBuilder(
+ Dialect dialect, Type identifierType, TypeResolver typeResolver, String[] columns, List