As you must be aware in MySQL namespaces and database are essentially the same thing.
How can I tell hibernate to use a particular db for an Entity. It by default uses the one defined in the spring.datasource.url. So here it would be looking entities in db1 database.
spring.datasource.url=jdbc:mysql://localhost:3306/db1
If I use
@Table(name= db2.sample_table) it looks for db1.db2_sample_table