In @Table(name = “tableName”) - make “tableName” a variable in JPA

后端 未结 5 1392
無奈伤痛
無奈伤痛 2020-12-16 14:35

I am using JPA and I need to make the \"tableName\" a variable.

In a database, I have many tables, and my code needs to access the table where I specify it to read.

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 15:22

    If you want to select data from different tables,

    then you can use :

    @Subselect("")

    instead of :

    @Table(name = "tableName").

提交回复
热议问题