@Component @Transactional public class GenerateSnowflakeId extends Object implements org.hibernate.id.IdentifierGenerator, org.hibernate.id.Configurable
| 构造器和说明 |
|---|
GenerateSnowflakeId() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
configure(org.hibernate.type.Type type,
Properties properties,
org.hibernate.service.ServiceRegistry d)
加载配置文件
|
Serializable |
generate(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object object)
hibernate自定义主键生成规则必须实现 IdentifierGenerator generate 为默认方法
|
private SnowflakeIdWorker |
getSlIdWorker() |
public Serializable generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object object) throws org.hibernate.HibernateException
generate 在接口中 org.hibernate.id.IdentifierGeneratororg.hibernate.HibernateExceptionprivate SnowflakeIdWorker getSlIdWorker()
public void configure(org.hibernate.type.Type type,
Properties properties,
org.hibernate.service.ServiceRegistry d)
throws org.hibernate.MappingException
configure 在接口中 org.hibernate.id.Configurableorg.hibernate.MappingExceptionCopyright © 2019. All rights reserved.