You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the temporary table strategy can not be used because the database user lacks privilege to create temporary tables,
390
-
the `InlineMutationStrategy` must be used.
389
+
The strategies outlined above depend on the creation of temporary tables, which Hibernate creates on startup if they don't already exist. At present this process is not integrated in the schema management tooling, and this requires that the user have the required permissions to alter the database schema.
391
390
392
-
To use this strategy, you need to configure the following configuration property:
391
+
If the Hibernate session user lacks these permissions, you will need to either:
392
+
393
+
* alter your schema through a different user with more permissions, to add a global temporary table named HTE_<root entity table name>, which contains all columns of all tables involved in the entity hierarchy. +
394
+
This will allow insert, update and delete in HQL for multi-table entities.
395
+
396
+
* OR configure Hibernate ORM to use the (badly-performing) inline strategy (for _mutations_ only!):
393
397
394
398
[source,xml]
395
399
----
@@ -398,7 +402,22 @@ To use this strategy, you need to configure the following configuration property
398
402
/>
399
403
----
400
404
401
-
Now, when running the previous test case, Hibernate generates the following SQL statements:
405
+
[IMPORTANT]
406
+
====
407
+
We strongly recommend the use of the first option, i.e. manually adding the temporary tables, because the inline strategy is set to be removed in a future release. Also, there is no equivalent strategy for inserts.
408
+
409
+
Additionally, automatic creation of temporary tables should be deactivated. This is done by setting the
410
+
411
+
`hibernate.query.mutation_strategy.global_temporary.create_tables` and `hibernate.query.mutation_strategy.global_temporary.drop_tables`
412
+
413
+
*or*
414
+
415
+
`hibernate.query.mutation_strategy.persistent.create_tables` and `hibernate.query.mutation_strategy.persistent.drop_tables`
416
+
417
+
properties (depending on the default strategy for the dialect) to `false`
418
+
====
419
+
420
+
With the inline strategy, when running the previous test case, Hibernate generates the following SQL statements:
0 commit comments