Java 类org.hibernate.id.UUIDGenerator 实例源码

项目:lams    文件:DefaultIdentifierGeneratorFactory.java   
/**
 * 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 );
}
项目:lams    文件:FileUtil.java   
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();
   }
项目:lams    文件:ForgotPasswordServlet.java   
/**
    * 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();
   }