From d477e80128fc3094e1365b0ddaa3497cbdf5974f Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 1 Aug 2001 00:10:52 +0000 Subject: [PATCH] introduced boolean "virtual" field, though it's not used yet. --- src/helma/objectmodel/Key.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helma/objectmodel/Key.java b/src/helma/objectmodel/Key.java index 40326565..44895c79 100644 --- a/src/helma/objectmodel/Key.java +++ b/src/helma/objectmodel/Key.java @@ -10,7 +10,7 @@ import java.io.Serializable; /** * This is the internal representation of a database key. It is constructed * out of the database URL, the table name, the user name and the database - * key of the node and unique within each HOP application. Currently only + * key of the node and unique within each Helma application. Currently only * single keys are supported. */ public class Key implements Serializable { @@ -18,24 +18,27 @@ public class Key implements Serializable { private String type; private String id; private int hash; + private boolean virtual; public Key (DbMapping dbmap, String id) { this.type = dbmap == null ? null : dbmap.getStorageTypeName (); this.id = id; hash = id.hashCode (); + virtual = false; } public Key (String type, String id) { this.type = type; this.id = id; hash = id.hashCode (); + virtual = false; } public boolean equals (Object what) { try { Key k = (Key) what; - return ((type == k.type || type.equals (k.type)) && (id == k.id || id.equals (k.id))); + return (type == k.type || type.equals (k.type)) && (id == k.id || id.equals (k.id)); } catch (Exception x) { return false; } @@ -52,7 +55,9 @@ public class Key implements Serializable { * a key that can't be mistaken for a relational db key. */ public Key getVirtualKey (String sid) { - return new Key ((String) null, makeVirtualID (type, id, sid)); + Key k = new Key ((String) null, makeVirtualID (type, id, sid)); + k.virtual = true; + return k; } public String getVirtualID (String sid) {