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

Java手工赋值id #103

Open
coderJYX opened this issue May 27, 2024 · 1 comment
Open

Java手工赋值id #103

coderJYX opened this issue May 27, 2024 · 1 comment

Comments

@coderJYX
Copy link

coderJYX commented May 27, 2024

使用mybatis初始化配置之后

        IdGeneratorOptions options = new IdGeneratorOptions((short) 1);
        options.SeqBitLength = 10;
        YitIdHelper.setIdGenerator(options);
        return YitIdHelper.nextId();

想手工赋值id的话,需要重新初始化一次吗,还是说直接使用YitIdHelper.nextId()获取即可

@chushiyun2015
Copy link

我这边分布式服务使用不同的workerId会出现id重复问题

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

No branches or pull requests

2 participants