本文整理汇总了Java中org.hibernate.id.UUIDGenerator类的典型用法代码示例。如果您正苦于以下问题:Java UUIDGenerator类的具体用法?Java UUIDGenerator怎么用?Java UUIDGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UUIDGenerator类属于org.hibernate.id包,在下文中一共展示了UUIDGenerator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateUniqueContentFolderID
import org.hibernate.id.UUIDGenerator; //导入依赖的package包/类
public static String generateUniqueContentFolderID() {
IdentifierGenerator uuidGen = new UUIDGenerator();
((Configurable) uuidGen).configure(StringType.INSTANCE, new Properties(), null);
// lowercase to resolve OS issues
return ((String) uuidGen.generate(null, null)).toLowerCase();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:FileUtil.java
示例2: generateUniqueKey
import org.hibernate.id.UUIDGenerator; //导入依赖的package包/类
/**
* Generates the unique key used for the forgot password request
*
* @return a unique key
* @throws FileUtilException
* @throws IOException
*/
public static String generateUniqueKey() {
Properties props = new Properties();
IdentifierGenerator uuidGen = new UUIDGenerator();
((Configurable) uuidGen).configure(StringType.INSTANCE, props, null);
return ((String) uuidGen.generate(null, null)).toLowerCase();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:ForgotPasswordServlet.java
示例3: DefaultIdentifierGeneratorFactory
import org.hibernate.id.UUIDGenerator; //导入依赖的package包/类
/**
* Constructs a new DefaultIdentifierGeneratorFactory.
*/
public DefaultIdentifierGeneratorFactory() {
register( "uuid2", UUIDGenerator.class );
register( "guid", GUIDGenerator.class ); // can be done with UUIDGenerator + strategy
register( "uuid", UUIDHexGenerator.class ); // "deprecated" for new use
register( "uuid.hex", UUIDHexGenerator.class ); // uuid.hex is deprecated
register( "hilo", TableHiLoGenerator.class );
register( "assigned", Assigned.class );
register( "identity", IdentityGenerator.class );
register( "select", SelectGenerator.class );
register( "sequence", SequenceGenerator.class );
register( "seqhilo", SequenceHiLoGenerator.class );
register( "increment", IncrementGenerator.class );
register( "foreign", ForeignGenerator.class );
register( "sequence-identity", SequenceIdentityGenerator.class );
register( "enhanced-sequence", SequenceStyleGenerator.class );
register( "enhanced-table", TableGenerator.class );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:DefaultIdentifierGeneratorFactory.java
注:本文中的org.hibernate.id.UUIDGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论