public final class Record
extends java.lang.Object
implements java.lang.Cloneable
The Record
is the input/output data format for components built on
Extended Server platform. Records have the same serialization format as
IFS Buffer
s, but are a higher level abstraction. Which makes them
much easier to use.
The data in a record is stored in the record's attributes. A record attribute can either be of a simple or compound type. Simple record attributes are those who have (or can have) a distinct value, such as a string, date or number. Compound record attributes have a complex value. There are two compund attribute types. Aggregate, which have another record as its value, and array, which have a list of records as its value.
For examples on invoking server operations and working with records, see the Foundation1 Development Guide.
Constructor and Description |
---|
Record()
The default constructor.
|
Record(java.lang.String recordType)
The Record's recordType will be set to the supplied string.
|
Modifier and Type | Method and Description |
---|---|
RecordAttribute |
add(java.lang.String nameOf)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.math.BigDecimal value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.math.BigDecimal value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
boolean value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
boolean value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
byte[] value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
byte[] value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
Bytedata value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
Bytedata value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.util.Date value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.util.Date value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
double value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
double value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
long value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
long value,
DataType dataType)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.lang.String value)
Add a attribute named
nameOf . |
RecordAttribute |
add(java.lang.String nameOf,
java.lang.String value,
DataType dataType)
Add a attribute named
nameOf . |
Record |
addAggregate(java.lang.String name)
Adds an aggregate to the Record's attributes.
|
RecordAttribute |
addAggregate(java.lang.String name,
Record rec)
Adds an aggregate to the Record's attributes and sets the the record.
|
Record |
addAggregate(java.lang.String name,
java.lang.String recordType)
Adds an aggregate to the Record's attributes.
|
RecordCollection |
addArray(java.lang.String name)
Adds an array to the Record's attributes.
|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
Record |
createLUStdOpBindVars(LUStdOp op)
Creates a standard set of bind variables used when invoking PL/SQL
operations with
invokePLSQL() . |
boolean |
equals(java.lang.Object obj)
Returns True if the supplied Record equals this Record.
|
void |
excludeQueryResult()
Excludes this from the query result.
|
boolean |
exists(java.lang.String name)
Returns
true if the Record has an attribute named name . |
RecordAttribute |
find(java.lang.String name)
Finds a RecordAttribute in the Record named
name and returns
a reference to it. |
java.lang.Object |
findValue(java.lang.String name) |
java.lang.Object |
findValue(java.lang.String name,
java.lang.Object defaultValue)
Finds a value in the Record's attributes.
|
java.lang.String |
format(java.lang.String pattern)
Format the attributes of a record into a user-defined string.
|
ifs.fnd.buffer.Buffer |
formatToBuffer()
Formats this record into a IFS
Buffer . |
java.lang.String |
formatToBufferString()
Formats this record into a string representation of its buffer.
|
RecordAttributeCollection |
getAttributes()
Returns a reference to the Record's attributes.
|
java.lang.String |
getIdentity()
Returns a unique identifier for this record.
|
RecordAttribute |
getKeyAttribute()
Returns this
Record 's key attribute. |
java.lang.String |
getRecordType()
Returns the record type for the record.
|
java.lang.String |
getRecordTypeFull()
Returns the full record type for the record.
|
RecordStatus |
getStatus()
Returns the Record's status.
|
java.lang.String |
getTag()
Gets the Tag attribute.
|
void |
handleLUStdOpBindVars(LUStdOp op,
Record bindVars)
Handles bind variables after a call to invokePLSQL (moves objid/objversion
attributes from bind variables to the record).
|
boolean |
hasValue(java.lang.String name)
Checks if the Record has an attribute named
name and checks
if that attribute has a value set (not null). |
void |
includeQueryResult()
Sets all attributes to be included in a query result.
|
void |
includeQueryResult(RecordAttributeStatus includeAs)
Sets all attributes to
includeAs . |
boolean |
isDirty()
Returns whether the Record is dirty or not.
|
boolean |
isRemoveAllowed()
Check if the record may be removed.
|
java.util.Iterator |
iterator()
Returns an
Iterator to the Record's attributes. |
void |
loadFromBuffer(ifs.fnd.buffer.Buffer buf)
Loads a record from a IFS
Buffer containing the data. |
void |
loadFromBufferString(java.lang.String bufferString)
Loads a record from a string containing its buffer.
|
void |
loadFromFile(java.lang.String fileName)
Loads a previously saved Record from file.
|
void |
parseItem(ifs.fnd.buffer.Item itm)
Deprecated.
to load a
Record from a Buffer , use
loadFromBuffer .
Parses an Item into the Record |
void |
remove(java.lang.String name)
Removes an attribute named
name from the Record, if it exists. |
void |
saveToFile(java.lang.String fileName)
Saves the Record to a file.
|
void |
setAttributes(RecordAttributeCollection rac)
Sets the Record's attribute collection.
|
void |
setLikeCondition(java.lang.String attrName,
java.lang.String value)
Sets a "attribute like value" condition on an attribute in this record.
|
void |
setNew()
Sets the Record's status to NEW.
|
void |
setQueried()
Sets the Record's status to QUERIED.
|
void |
setRecordType(java.lang.String recordType)
Sets the recordType for the Record.
|
void |
setRemoved()
Sets the Record's status to REMOVED.
|
void |
setTag(java.lang.String tag)
Sets the Tag attribute.
|
java.lang.String |
toString()
Returns a string representation of the Record.
|
void |
touch()
Touches the Record, ie makes it look modified if (it already isn't).
|
public Record()
public Record(java.lang.String recordType)
public RecordAttribute add(java.lang.String nameOf)
nameOf
.public RecordAttribute add(java.lang.String nameOf, long value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, long value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, double value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, double value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.math.BigDecimal value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.math.BigDecimal value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, boolean value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, boolean value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, byte[] value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, byte[] value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.util.Date value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.util.Date value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, Bytedata value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, Bytedata value, DataType dataType)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.lang.String value)
nameOf
.public RecordAttribute add(java.lang.String nameOf, java.lang.String value, DataType dataType)
nameOf
.public Record addAggregate(java.lang.String name)
public Record addAggregate(java.lang.String name, java.lang.String recordType)
public RecordAttribute addAggregate(java.lang.String name, Record rec)
public RecordCollection addArray(java.lang.String name)
public void setLikeCondition(java.lang.String attrName, java.lang.String value)
attrName
- name of an attribute in this recordvalue
- the value to compare the attribute to. Use wildcards '%' and '_'.public java.lang.Object clone()
clone
in class java.lang.Object
Object
public Record createLUStdOpBindVars(LUStdOp op)
invokePLSQL()
.op
- the type of operation to be called (different sets of standard
bind variables).public void handleLUStdOpBindVars(LUStdOp op, Record bindVars)
op
- the type of operation to be called (different sets of standard
bind variables).bindVars
- the bind variables used for the call.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void excludeQueryResult()
public boolean exists(java.lang.String name)
true
if the Record has an attribute named name
.public RecordAttribute find(java.lang.String name)
name
and returns
a reference to it. If it's not found, null
is returned.public java.lang.Object findValue(java.lang.String name, java.lang.Object defaultValue)
name
- the name of the attribute to find the value for.defaultValue
- a default value to return if the attribute is not found.public java.lang.Object findValue(java.lang.String name)
null
if the attribute is not found.public boolean hasValue(java.lang.String name)
name
and checks
if that attribute has a value set (not null).public void remove(java.lang.String name)
name
from the Record, if it exists.public void setAttributes(RecordAttributeCollection rac)
public RecordAttributeCollection getAttributes()
public void includeQueryResult()
public void includeQueryResult(RecordAttributeStatus includeAs)
includeAs
.public void loadFromFile(java.lang.String fileName) throws APException, java.io.IOException
APException
java.io.IOException
public void saveToFile(java.lang.String fileName) throws APException, java.io.IOException
APException
java.io.IOException
public void parseItem(ifs.fnd.buffer.Item itm) throws APException
Record
from a Buffer
, use
loadFromBuffer
.
Parses an Item into the Recordpublic java.lang.String getIdentity()
public RecordAttribute getKeyAttribute()
Record
's key attribute. That is the first
RecordAttribute
set as a key. If there is no key attribute
in this Record, null
is returned.public java.lang.String getRecordType()
public java.lang.String getRecordTypeFull()
public void setRecordType(java.lang.String recordType)
recordType
- A string containing the recordType to be set.public RecordStatus getStatus()
public void setNew()
public void setQueried()
public void setRemoved()
public java.lang.String getTag()
public void setTag(java.lang.String tag)
public java.lang.String toString()
toString
in class java.lang.Object
public void touch()
public boolean isDirty()
public java.util.Iterator iterator()
Iterator
to the Record's attributes.public java.lang.String format(java.lang.String pattern)
rec.format(":ID (:NAME)");
"jdoe (Jane Doe)"
if there are
RecordAttributes named ID & NAME.PreparedString
public ifs.fnd.buffer.Buffer formatToBuffer() throws APException
Buffer
.APException
public java.lang.String formatToBufferString() throws APException
APException
public void loadFromBuffer(ifs.fnd.buffer.Buffer buf) throws APException
Buffer
containing the data.buf
- the Buffer
with data.APException
public void loadFromBufferString(java.lang.String bufferString) throws APException
APException
public boolean isRemoveAllowed()