FileDocCategorySizeDatePackage
DatabaseRecord.javaAPI DocGlassfish v2 API9283Tue May 22 16:54:52 BST 2007oracle.toplink.essentials.sessions

DatabaseRecord

public class DatabaseRecord extends AbstractRecord

Purpose: Define a representation of a database row as field=>value pairs. This is the database row implementation class, the Record or java.util.Map interfaces should be used to access this class instead of the implemention class.

Responsibilities:

  • Implement the common hashtable collection protocol.
  • Allow get and put on the field or field name.
see
DatabaseField
see
Record
see
java.util.Map

Fields Summary
Constructors Summary
public DatabaseRecord()
INTERNAL: Returns a record (of default size).

        super();
    
public DatabaseRecord(int initialCapacity)
INTERNAL: Returns a record of the given initial capacity.

param
initialCapacity

        super(initialCapacity);
    
public DatabaseRecord(Vector fields, Vector values)
INTERNAL: Builds row from database result fields and values. Note: the entire database result will share the same fields vector.

param
fields Vector of fields
param
values Vector of values

        super(fields, values);
    
Methods Summary
public voidclear()
PUBLIC: Clears the contents of the database row, both fields and values.

        super.clear();
    
public booleancontains(java.lang.Object value)
PUBLIC: Checks if the given Object value is contained in the values held in the database row.

param
value the Object to be considered
return
boolean - true if the Object value is in the row.

        return super.containsValue(value);
    
public booleancontainsKey(java.lang.Object key)
PUBLIC: Checks if a key (ie. the field) is contained in the database row. Conforms to a hashtable interface.

param
key an Object, either String or DatabaseField
return
boolean - true if the row with the corresponding key is in the row.

        return super.containsKey(key);
    
public booleancontainsKey(java.lang.String fieldName)
PUBLIC: Checks if a given field is contained in the database row.

param
key String, the DatabaseField name
return
boolean - true if the row contains the key with the corresponding fieldName.

        return super.containsKey(fieldName);
    
public booleancontainsValue(java.lang.Object value)
PUBLIC: Checks if the given Object value is contained in the values held in the database row.

param
value the Object under consideration
return
boolean - true if the row contains the Object as a value

        return super.containsValue(value);
    
public java.util.Enumerationelements()
PUBLIC: Returns an Enumeration of the values in the database row.

return
Enumeration

        return super.elements();
    
public java.util.SetentrySet()
PUBLIC: Returns a set of map entries (ie. field-value pairs)in the database row with the DatabaseFields as keys and the value Objects as values.

see
java.util.Map#entrySet()
return
Set - the set of all the field-value entries (see java.util.Map.Entry)

        return super.entrySet();
    
public java.lang.Objectget(java.lang.Object key)
PUBLIC: Retrieves the value for the given key. A field is constructed with the key to check the hash table. If missing, null is returned.

param
key Object, either String or DatabaseField
return
Object

    	return super.get(key);
    
public java.lang.Objectget(java.lang.String fieldName)
PUBLIC: Retrieves the value with the given name of the DatabaseField. A field is constructed on the name to check the hash table. If missing, null is returned.

param
fieldName String, the DatabaseField name
return
Object - the value

       return super.get(fieldName);
    
public java.lang.ObjectgetIndicatingNoEntry(java.lang.String fieldName)
PUBLIC: Retrieves the value with the given field name. A field is constructed on the name to check the hash table. If missing, DatabaseRow.noEntry is returned.

param
fieldName String, the DatabaseField name
return
Object - the value

       return super.getIndicatingNoEntry(fieldName);
    
public java.lang.ObjectgetValues(oracle.toplink.essentials.internal.helper.DatabaseField key)
PUBLIC: Returns the Object associated with the given key (null if the key does not map to an Object.)

param
key DatabaseField
return
Object - the value associated with the key

        return super.get(key);
    
public java.lang.ObjectgetValues(java.lang.String key)
PUBLIC: Returns the Object associated with the given key (null if the key does not map to an Object.)

param
key String
return
Object - the value associated with the key

        return super.get(key);
    
public booleanisEmpty()
PUBLIC: Checks if the database row is empty (ie. there are no field-value pairs.)

return
boolean - true if the database row is empty

        return super.isEmpty();
    
public java.util.SetkeySet()
PUBLIC: Returns a set of the keys, the DatabaseField Objects, for the database row.

return
Set of the keys

        return super.keySet();
    
public java.util.Enumerationkeys()
PUBLIC: Returns an Enumeration of the DatabaseField Objects.

return
Enumeration

        return super.keys();
    
public java.lang.Objectput(java.lang.Object key, java.lang.Object value)
PUBLIC: Adds a field-value pair to the row.

param
key Object, either String or DatabaseField
param
value Object
return
Object - the previous Object with that key, could be null
throws
ValidationException if inappropriate key is used

    	return super.put(key, value);
    
public java.lang.Objectput(java.lang.String key, java.lang.Object value)
PUBLIC: Adds a field-value pair to the row.

param
key String
param
value Object
return
Object - the previous Object with that key, could be null

        return super.put(key, value);
    
public voidputAll(java.util.Map map)
PUBLIC: Adds all of the elements in the given map to the database row.

param
map Map of all the field-value elements to be added

    	super.putAll(map);
    
public intsize()
PUBLIC: Returns the number of field-value pairs in the database row.

return
int

        return super.size();
    
public java.util.Collectionvalues()
PUBLIC: Returns a collection of the values held in the database row.

return
Collection of value Objects

        return super.values();