lMasterSparkl commented on issue #7703:
URL:
https://github.com/apache/shardingsphere/issues/7703#issuecomment-1067909193
> > So a safer option would be to define an Annotation, something like
"@ForceWhereClause" which should then indicate to sharding-sphere that it has
to use the value from SET clause and either use that to figure out which is the
target shard, or put in a where clause along in the final statement and let
things happen naturally.
>
> @sabz90 I think adding annotations is a good idea, but I think it is more
appropriate for hibernate to provide this annotation. Users can freely control
which fields are added to the `WHERE` clause and which fields are added to the
`SET` clause through hibernate annotations.
@tristaZero @strongduanmu @heqiao @sabz90 @qiuxiaotong2021
hey guys I have read all this issue's comments and think it's necessary to
reopen this issue .
### First
I think the comment I have quote is not the final reply that
> more appropriate for hibernate to provide this annotation
and it doesn't solution the problem.
### Second
let me example:
table AAA use 'id' as primary key and use 'did' as sharding key .
now I need to edit some columns from backstage, I think it's a very easy and
universal function, but wow it says **'Can not update sharding key'** and don't
have Elegant solutions, now I have to judge every column and use jpa‘s
nativeQuery to update columns .
we use did to distinguish different user so it can be the same.
### Final
let me guess the question I have figure out when I have debug,

in this pic shardingValue is empty and I deep in

in this pic shows shardingColumn is 'did' but in Evaluate I excute
column.getIdentifier().getValue() and it return 'id' so i think it just
consider when shardingColumn is primary key and value equals and then pass but
not contain when shardingKey is not primary key's case.
my english is not good but I'd like to discuss this problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]