We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我再hibernate自定义了一个ID生成器,如何在替换这里的逻辑使CosId的雪花ID生成器生效?
public class YuIdGenerator implements IdentifierGenerator { static SnowFlake snowFlake; static { snowFlake = new SnowFlake(1, 1); } @Override public Serializable generate(SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws HibernateException { return snowFlake.nextId(); } }
import jakarta.persistence.Id; /** * 主键 */ @Id @GenericGenerator(name = "yu_id", strategy = "com.xxx.common.jpa.xxx.YuIdGenerator") @GeneratedValue(generator = "yu_id") private Long id;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我再hibernate自定义了一个ID生成器,如何在替换这里的逻辑使CosId的雪花ID生成器生效?
The text was updated successfully, but these errors were encountered: