【问题标题】:best way to create Intershop UUIDs创建 Intershop UUID 的最佳方法
【发布时间】:2018-06-06 21:03:18
【问题描述】:

如标题所述,是否有任何首选方法可以创建供 Intershop 使用的 UUID(例如,jobs)? UUID 需要具体吗?

【问题讨论】:

    标签: intershop


    【解决方案1】:

    对于迁移或手动使用 uuid,有一个 ant 任务:

    ES1|...\eserver\...\tools\misc>ant uuid
    Buildfile: build.xml
    build.environment:
    uuid:
    createuuid.classpath:
    createuuid:
         [echo] Generating an amount of 5 UUIDs...
         [java] UUID: fMsKAB2ZfRcAAAEwtG8luGUc
         [java] UUID: qB8KAB2Z2UQAAAEwtm8luGUc
         [java] UUID: nkgKAB2Z2UUAAAEwtm8luGUc
         [java] UUID: Yg0KAB2Z2UYAAAEwtm8luGUc
         [java] UUID: gGcKAB2Z2UcAAAEwtm8luGUc
    

    【讨论】:

      【解决方案2】:

      UUIDMgr 已弃用。请用 com.intershop.beehive.core.capi.util.UUIDGenerator 代替。

      @Inject
      private UUIDGenerator uuidGenerator;
      ...
      String uuid = uuidGenerator.createUUIDString();
      

      【讨论】:

      • 另一种创建一些 UUID 以在 DBInit 配置中使用的可能性是在部署服务器的 tools/misc 中调用 ant uuid。
      • 如果您需要 UUID 用于迁移,数据库包含一个函数“sf_create_uuid”。
      【解决方案3】:

      如果您需要在管道中创建 UUID,您可以使用 CreateUUID.pipelet

      如果您想在您的自定义 Java 代码中创建 UUID,您可以像这样创建它(此代码只是 CreateUUID 管道的副本):

      @Inject
      private UUIDGenerator uuidGen;
      
      String uuid = uuidGen.createUUIDString();
      

      【讨论】:

        猜你喜欢
        • 2015-09-09
        • 2023-03-26
        • 2013-01-22
        • 2020-06-21
        • 1970-01-01
        • 1970-01-01
        • 2012-01-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多