PiPo2 - don't auto generate uuid for record with official id.

This commit is contained in:
Heng Sin Low 2011-02-21 19:30:21 +08:00
parent b1d1908f24
commit 745320642c
1 changed files with 5 additions and 2 deletions

View File

@ -151,11 +151,14 @@ public class UUIDGenerator extends SvrProcess {
stmt.setFetchSize(100); stmt.setFetchSize(100);
rs = stmt.executeQuery(); rs = stmt.executeQuery();
while (rs.next()) { while (rs.next()) {
UUID uuid = UUID.randomUUID();
if (AD_Column_ID > 0) { if (AD_Column_ID > 0) {
int recordId = rs.getInt(1); int recordId = rs.getInt(1);
if (recordId > MTable.MAX_OFFICIAL_ID) {
UUID uuid = UUID.randomUUID();
DB.executeUpdateEx(updateSQL+recordId,new Object[]{uuid.toString()},null); DB.executeUpdateEx(updateSQL+recordId,new Object[]{uuid.toString()},null);
}
} else { } else {
UUID uuid = UUID.randomUUID();
String rowId = rs.getString(1); String rowId = rs.getString(1);
DB.executeUpdateEx(updateSQL+"'"+rowId+"'",new Object[]{uuid.toString()},null); DB.executeUpdateEx(updateSQL+"'"+rowId+"'",new Object[]{uuid.toString()},null);
} }