Skip to content

如何用SpringData JPA去连接table with dynamic name? #47

Description

@bihjuchiu

当define table 的时候, table name 是define在@table的name里, 如下例:

======================================================
@entity
@DaTa
@table(name = "category", indexes = {@Index(name = "index_category_name", columnList = "categoryName", unique = true)})
public class Category {
@id
@GeneratedValue
private long id;

======================================================
但是如果table name 是每日更新的话,比如:
name = category_mm_dd_yyyy
ex:
category_01_01_2017: category generated at 01/01/2017
category_01_02_2017: category generated at 01/02/2017
category_01_03_2017: category generated at 01/03/2017

有没有办法设计 Category object 去dynamically更新table name?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions