I want to update two tables using hibernate query which modifies a common column in both the tables. I would like to write the query in hibernate without using update statement. I want to use select statement which is equal to update statement.
You can write a select statement to select an entity. When you make changes to that entity the provider will detect that the entity is dirty (has been changed) and when the transaction commits the persistence provider will generate an update statement for you to update the table. But in the end whether you write it or it is generated by the persistence provider Bear is 100% correct it is an update statement that updates the table. I would recommend learning fundamentals first before tackling an ORM as some of this may be hidden from you and might seem confusing. If you are using hibernate you can configure it to output the SQL it generates which will help you to see what is actually happening.
The important take away is that the following statement is not correct.
I want to use select statement which is equal to update statement.