I think you have taken the query example from
this page.
The given query works fine for me.
You have to notice that the
HQL query needs to have the class names (not the database table names and fields).
And also you need to map the entity classes (Test1, BackupStock) to the database tables using proper hibernate mapping files.
Also, the transaction start and end is required for the insert to become effective in the database.
Here is the code snippet that works for me.