public class DatabaseRecord
extends org.eclipse.persistence.internal.sessions.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 implementation class.
Responsibilities:
DatabaseField
,
Record
,
Map
,
Serialized FormConstructor and Description |
---|
DatabaseRecord()
INTERNAL:
Returns a record (of default size).
|
DatabaseRecord(int initialCapacity)
INTERNAL:
Returns a record of the given initial capacity.
|
DatabaseRecord(Vector fields,
Vector values)
INTERNAL:
Builds row from database result fields and values.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
PUBLIC:
Clears the contents of the database row, both fields and values.
|
boolean |
contains(Object value)
PUBLIC:
Checks if the given Object value is contained in the values held
in the database row.
|
boolean |
containsKey(Object key)
PUBLIC:
Checks if a key (ie.
|
boolean |
containsKey(String fieldName)
PUBLIC:
Checks if a given field is contained in the database row.
|
boolean |
containsValue(Object value)
PUBLIC:
Checks if the given Object value is contained in the values held
in the database row.
|
Enumeration |
elements()
PUBLIC:
Returns an Enumeration of the values in the database row.
|
Set |
entrySet()
PUBLIC:
Returns a set of map entries (ie.
|
Object |
get(Object key)
PUBLIC:
Retrieves the value for the given key.
|
Object |
get(String fieldName)
PUBLIC:
Retrieves the value with the given name of the DatabaseField.
|
Object |
getIndicatingNoEntry(String fieldName)
PUBLIC:
Retrieves the value with the given field name.
|
Object |
getValues(org.eclipse.persistence.internal.helper.DatabaseField key)
PUBLIC:
Returns the Object associated with the given key
(null if the key does not map to an Object.)
|
Object |
getValues(String key)
PUBLIC:
Returns the Object associated with the given key
(null if the key does not map to an Object.)
|
boolean |
isEmpty()
PUBLIC:
Checks if the database row is empty (ie.
|
Enumeration |
keys()
PUBLIC:
Returns an Enumeration of the DatabaseField Objects.
|
Set |
keySet()
PUBLIC:
Returns a set of the keys, the DatabaseField Objects, for the database row.
|
Object |
put(Object key,
Object value)
PUBLIC:
Adds a field-value pair to the row.
|
Object |
put(String key,
Object value)
PUBLIC:
Adds a field-value pair to the row.
|
void |
putAll(Map map)
PUBLIC:
Adds all of the elements in the given map to the database row.
|
int |
size()
PUBLIC:
Returns the number of field-value pairs in the database row.
|
Collection |
values()
PUBLIC:
Returns a collection of the values held in the database row.
|
add, clone, containsKey, get, getField, getFields, getIndicatingNoEntry, getValues, mergeFrom, put, remove, remove, remove, replaceAt, toString
public DatabaseRecord()
public DatabaseRecord(int initialCapacity)
initialCapacity
- public void clear()
public boolean contains(Object value)
contains
in class org.eclipse.persistence.internal.sessions.AbstractRecord
value
- the Object to be consideredpublic boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- an Object, either String or DatabaseFieldpublic boolean containsKey(String fieldName)
containsKey
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- String, the DatabaseField namepublic boolean containsValue(Object value)
containsValue
in interface Map
containsValue
in class org.eclipse.persistence.internal.sessions.AbstractRecord
value
- the Object under considerationpublic Enumeration elements()
elements
in class org.eclipse.persistence.internal.sessions.AbstractRecord
public Set entrySet()
entrySet
in interface Map
entrySet
in class org.eclipse.persistence.internal.sessions.AbstractRecord
Map.entrySet()
public Object get(Object key)
public Object get(String fieldName)
get
in class org.eclipse.persistence.internal.sessions.AbstractRecord
fieldName
- String, the DatabaseField namepublic Object getIndicatingNoEntry(String fieldName)
getIndicatingNoEntry
in class org.eclipse.persistence.internal.sessions.AbstractRecord
fieldName
- String, the DatabaseField namepublic Object getValues(org.eclipse.persistence.internal.helper.DatabaseField key)
getValues
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- DatabaseFieldpublic Object getValues(String key)
getValues
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- Stringpublic boolean isEmpty()
public Enumeration keys()
keys
in class org.eclipse.persistence.internal.sessions.AbstractRecord
public Set keySet()
public Object put(Object key, Object value) throws ValidationException
put
in interface Map
put
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- Object, either String or DatabaseFieldvalue
- ObjectValidationException
- if inappropriate key is usedpublic Object put(String key, Object value)
put
in class org.eclipse.persistence.internal.sessions.AbstractRecord
key
- Stringvalue
- Objectpublic void putAll(Map map)
public int size()
public Collection values()