From 26cefdcfac42f94ff8ba831e3e40e50a81e43f52 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Tue, 2 Oct 2012 18:53:12 -0700 Subject: [PATCH] When UUID field is null for existing records, set it to id Conflicts: server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java --- server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java b/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java index 7be63ba562d..c6fd8c17c9c 100644 --- a/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java +++ b/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java @@ -21,7 +21,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; -import java.util.UUID; import javax.ejb.Local; @@ -235,8 +234,9 @@ public class IdentityDaoImpl extends GenericDaoBase implements String.format("UPDATE `%s` SET uuid=? WHERE id=?", tableName) ); - pstmtUpdate.setString(1, UUID.randomUUID().toString()); + pstmtUpdate.setString(1, String.valueOf(id)); pstmtUpdate.setLong(2, id); pstmtUpdate.executeUpdate(); } } +