| The test is using a wrong syntax for HQL bulk insert. According to the 5.1 docs, this is how the syntax should look:
int insertedEntities = session.createQuery(
"insert into Partner (id, name) " +
"select p.id, p.name " +
"from Person p ")
.executeUpdate();
In your case, this how it looks like:
insert into MyLog2 (text) select :text from MyLog2
Now, you should, of course, select the `text` property instead of supplying it as an argument. But what causes you to think that Hibernate does not insert any row is just the fact that you try to insert rows by selecting from an empty table. So, even if you change the query to:
insert into MyLog2 (text) select text from MyLog2
Because there is no row in MyLog2, you are going to insert nothing. The HQL bulk insert is meant to copy data from a source table to a target one, but if the source table is empty, there will be no row being copied. |