heqiao commented on issue #7703: URL: https://github.com/apache/shardingsphere/issues/7703#issuecomment-1078683498
Hello folks! It has been a while since I attempted to work around this issue. I kinda agreed upon that this is more a JPA enhancement rather than a shardingsphere one. @lMasterSparkl Thanks for sharing! I did try the same approach - creating a customized annotation, extending `EmptyInterceptor`, intercept during onPrepareStatement. However, it was hacky enough that I ended up with sticking to the CompositeId approach. The main concern was replacing " where " on sql preparing. Although "where" is reserved, there is a chance that it's get included in the sql and I prefer not to risk it. The CompositeId approach does work, but the code is neither pretty nor succinct. I did not investigate further, but an ideal solution IMO would be creating a property annotation and treat that property of the Entity differently, thus avoiding sql injection like replacement. This may involve more expertise in the JPA community, something that could be explored. -- 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]
