Limit the ID valid range to be either numeric -1L for special usage or in range that it hits a DB record

This commit is contained in:
Kelven Yang 2011-11-28 11:36:11 -08:00
parent be87e3214e
commit a7ac3d577a
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ public class IdentityDaoImpl extends GenericDaoBase<IdentityVO, Long> 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.");