Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrudRepositories with dynamic table names [DATAJDBC-358] #580

Closed
spring-projects-issues opened this issue Apr 10, 2019 · 2 comments
Closed

CrudRepositories with dynamic table names [DATAJDBC-358] #580

spring-projects-issues opened this issue Apr 10, 2019 · 2 comments
Assignees
Labels
in: repository status: duplicate type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Apr 10, 2019

Philipp Jauert opened DATAJDBC-358 and commented

We have a few set of database tables which should created, duplicated (renamed) and deleted dynamically during runtime. Thats are "audit" tables with a numeric suffix (e.g. USER_2, USER_42, ADDRESS_2, ADDRESS_42).

So we have the same structure but the table name differs. It is possible to use different tablenames on an existing CrudRepository when we invoke the methods?


Issue Links:

  • DATAJDBC-208 SqlGenerator caches statement thereby disabling dynamic NamingStrategies
    ("duplicates")
@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 10, 2019

Jens Schauder commented

Currently this doesn't work, because Spring Data JDBC does cache generated SQL statements.
But it should be fairly easy to make this caching controllable by the NamingStrategy.

Add an attribute getCacheKey or similar and the returned key is used to maintain separate caches of the statements.

The NamingStrategy then could create different table names, column names and cache keys depending on the context

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 16, 2019

Jens Schauder commented

This is a duplicate of DATAJDBC-208

@spring-projects-issues spring-projects-issues added in: repository type: enhancement status: duplicate labels Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository status: duplicate type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants