如何将十六进制 ID(从 Oracle/DB2)转换为 GUID(FileNet 标准)?
How to convert hexadecimal IDs (from Oracle/DB2) to GUID (FileNet standard)?
直接在 FileNet(Oracle 或 IBM DB2)使用的数据库上搜索对象提供十六进制 ID,如下所示:
F324E0C2A4AA884FACAAE6918AFFB163
如何使用 Java API 将它们转换为 GUID 标准,即 FileNet 使用的标准?结果示例:
{C2E024F3-AAA4-4F88-ACAA-E6918AFFB163}
public static String hexToGUID(String hex) {
return "{" + hex.substring(6, 8) + hex.substring(4, 6) + hex.substring(2, 4) + hex.substring(0, 2) + "-"
+ hex.substring(10, 12) + hex.substring(8, 10) + "-" + hex.substring(14, 16) + hex.substring(12, 14)
+ "-" + hex.substring(16, 18) + hex.substring(18, 20) + "-" + hex.substring(20, 22)
+ hex.substring(22, 24) + hex.substring(24, 26) + hex.substring(26, 28) + hex.substring(28, 30)
+ hex.substring(30, 32) + "}";
}
直接在 FileNet(Oracle 或 IBM DB2)使用的数据库上搜索对象提供十六进制 ID,如下所示:
F324E0C2A4AA884FACAAE6918AFFB163
如何使用 Java API 将它们转换为 GUID 标准,即 FileNet 使用的标准?结果示例:
{C2E024F3-AAA4-4F88-ACAA-E6918AFFB163}
public static String hexToGUID(String hex) {
return "{" + hex.substring(6, 8) + hex.substring(4, 6) + hex.substring(2, 4) + hex.substring(0, 2) + "-"
+ hex.substring(10, 12) + hex.substring(8, 10) + "-" + hex.substring(14, 16) + hex.substring(12, 14)
+ "-" + hex.substring(16, 18) + hex.substring(18, 20) + "-" + hex.substring(20, 22)
+ hex.substring(22, 24) + hex.substring(24, 26) + hex.substring(26, 28) + hex.substring(28, 30)
+ hex.substring(30, 32) + "}";
}