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

Add the ability to change a table name to AliasableSqlTable #572

Merged
merged 13 commits into from Jan 7, 2023

Conversation

jeffgbutler
Copy link
Member

This creates a new instance of the table and all it's enclosed fields. This is useful for sharded databases.

Resolves #563

This mapper doesn't include the typed inserts,
so it can easily be used without a class that
matches a table row.
This is to more easily support sharding - we
can create multiple new table objects with
differing names, but other attributes the same.

Or, we can create a table object with a supplier
function that will change the table name
at render time. This capability is NOT thread safe.
Name supplier creates an effectively mutable object
and this is against the principles of the library.
A supplier creates an effectively mutable object
and this is against the principles of the library.

The AliasableSqlTable object provides support for
changing the table name and should be used instead.
# Conflicts:
#	src/main/java/org/mybatis/dynamic/sql/util/mybatis3/CommonGeneralInsertMapper.java
@jeffgbutler jeffgbutler added this to the 1.5.0 milestone Jan 7, 2023
@jeffgbutler jeffgbutler merged commit 7cbc7c2 into mybatis:master Jan 7, 2023
@coveralls
Copy link

coveralls commented Jan 7, 2023

Coverage Status

Coverage: 100.0%. Remained the same when pulling 7253471 on jeffgbutler:sharding-support into 84df515 on mybatis:master.

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

Successfully merging this pull request may close these issues.

Is there any practice of table sharding?
2 participants