0

My requirement is to change the table name while inserting the records.

I want to change the table name to users_myCompany where myCompany will change for each and every query.

Example: I have a api called user/settings, User does a api call from company_1 the table name for the entity Users must be set as Users_company_1 and if the user is doing a api call from company 2, the table name for the entity must be set as users_company_2.

Sharath
  • 76
  • 3
  • 1
    https://stackoverflow.com/help/how-to-ask – VynlJunkie Dec 20 '21 at 11:52
  • Put in some trial and run you have done. Show some efforts which you have done. – V_J Dec 28 '21 at 08:43
  • Got the answer here. https://stackoverflow.com/questions/51417368/jpa-change-entity-table-name-base-on-request-parameter – Sharath Jan 27 '22 at 06:49
  • Does this answer your question? [In @Table(name = "tableName") - make "tableName" a variable in JPA](https://stackoverflow.com/questions/2444962/in-tablename-tablename-make-tablename-a-variable-in-jpa) – Jens Schauder Sep 29 '22 at 07:28

0 Answers0