com.wudaosoft.commons.persistence.Base58UUIDGenerator Maven / Gradle / Ivy
/*
* Copyright(c)2010-2017 WUDAOSOFT.COM
*
* Email:[email protected]
*
* QQ:275100589
*/
package com.wudaosoft.commons.persistence;
import java.io.Serializable;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;
import com.wudaosoft.commons.utils.UUIDUtils;
/**
* @author Changsoul Wu
*
*/
public class Base58UUIDGenerator implements IdentifierGenerator {
/* (non-Javadoc)
* @see org.hibernate.id.IdentifierGenerator#generate(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
*/
@Override
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
return UUIDUtils.base58Uuid();
}
}