You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/30 04:38:27 UTC

[GitHub] [shardingsphere] williamXinCC opened a new issue, #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

williamXinCC opened a new issue, #18721:
URL: https://github.com/apache/shardingsphere/issues/18721

   my key generator
   @Slf4j
   public final class SeeingflowKeyGenerator implements KeyGenerateAlgorithm{
   
       private Properties properties = new Properties();
   
       @Override
       public String getType() {
           return "SeeingflowKeyGenerator";
       }
   
   //    @Override
   //    public synchronized Comparable<?> generateKey() {
   //        GenerationFeginClient generationFeginClient = SpringUtil.getBean(GenerationFeginClient.class);
   //        return generationFeginClient.getKey();
   //    }
   
       @Override
       public synchronized String generateKey() {
           System.out.println("==================generateKey=====================");
           GenerationFeginClient generationFeginClient = SpringUtil.getBean(GenerationFeginClient.class);
           return generationFeginClient.getKey();
       }
   
       @Override
       public Properties getProps() {
           System.out.println("getProps=======================================SeeingflowKeyGenerator");
           return properties;
       }
   
       @Override
       public void init(Properties properties) {
           System.out.println("初始化=======================================SeeingflowKeyGenerator");
       }
   
   
   
   config
      shardingRuleConfig.setDefaultKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id","SeeingflowKeyGenerator"));
           shardingRuleConfig.getKeyGenerators().put("SeeingflowKeyGenerator", new 
      ShardingSphereAlgorithmConfiguration("SeeingflowKeyGenerator", null));
   
   mybatis-plus po
   public class EventsLog implements Serializable {
   
       private static final long serialVersionUID = 1L;
   
   //    @TableId(value = "id",type = IdType.Auto)
       @ApiModelProperty(value = "事件id")
           private String id;
   
   log alert
    2022-06-30 11:52:41.742  INFO 22732 --- [           main] o.s.s.c.ThreadPoolTaskExecutor           : Initializing ExecutorService 'applicationTaskExecutor'
   2022-06-30 11:52:41.839  INFO 22732 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'Nacos-Watch-Task-Scheduler'
   ====================getKeyGenerators====================
   {
       "SeeingflowKeyGenerator": {
           "type": "SeeingflowKeyGenerator",
           "props": {
           }
       }
   }
   2022-06-30 11:52:42.846  INFO 22732 --- [           main] c.a.d.p.DruidDataSource                  : {dataSource-1,db1} inited
   2022-06-30 11:52:43.948  INFO 22732 --- [           main] c.a.d.p.DruidDataSource                  : {dataSource-2,db0} inited
   2022-06-30 11:52:44.142  INFO 22732 --- [           main] c.a.d.p.DruidDataSource                  : {dataSource-3,db2} inited
   
   Spi has bean loaded
   So,how to use customer key generator?
   mybatis-plus 3.4.3
   shardingsphere 5.1.2


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1364912587

   Close due to no response.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use
URL: https://github.com/apache/shardingsphere/issues/18721


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] williamXinCC commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
williamXinCC commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1171090806

   @strongduanmu I have sent the project to your email. If you have time, please help to have a look


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] williamXinCC commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
williamXinCC commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1183070897

   @terrymanu nothing, could you show me same example for customer generator key by version5.1.1 or 5.1.2?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1193643749

   @williamXinCC Sorry, I have no time to investigate and show example with 3rd party ORM libraries. Could you do it, or if you have no time too, can you just close the issue?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] lymzcq1993 commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
lymzcq1993 commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1211555152

   mybatis plus have default ID generation  snowflake+uuid  since 3.3.0.
   need ignore mybatis plus ID gengration
   
   ```
       @TableId(value = "id",type = IdType.AUTO)
       private Long id;
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1179497522

   @williamXinCC Any update?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN closed issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use
URL: https://github.com/apache/shardingsphere/issues/18721


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1272349524

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1172236076

   > @strongduanmu I have sent the project to your email. If you have time, please help to have a look
   
   Can you submit the project codes to GitHub? Handle private problem by email is not the open source way.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #18721: mybatis-plus + 5.1.2,KeyGenerateAlgorithm can not be use

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #18721:
URL: https://github.com/apache/shardingsphere/issues/18721#issuecomment-1170892973

   @williamXinCC Can you dig into the logic of mybatis plus and investigate the cause of the 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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org