From a7ac3d577a38a81fbe9e637c6eecb4b2a59f1b1a Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Mon, 28 Nov 2011 11:36:11 -0800 Subject: [PATCH] Limit the ID valid range to be either numeric -1L for special usage or in range that it hits a DB record --- server/src/com/cloud/identity/dao/IdentityDaoImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/identity/dao/IdentityDaoImpl.java b/server/src/com/cloud/identity/dao/IdentityDaoImpl.java index bb514bed9fd..dddb5812b01 100644 --- a/server/src/com/cloud/identity/dao/IdentityDaoImpl.java +++ b/server/src/com/cloud/identity/dao/IdentityDaoImpl.java @@ -75,7 +75,7 @@ public class IdentityDaoImpl extends GenericDaoBase implements if(rs.next()) { return rs.getLong(1); } else { - if(id != 0) + if(id == -1L) return id; throw new InvalidParameterValueException("Object " + tableName + "(uuid: " + identityString + ") does not exist.");