FileDocCategorySizeDatePackage
FieldResult.javaAPI DocGlassfish v2 API4355Tue May 22 16:54:50 BST 2007oracle.toplink.essentials.queryframework

FieldResult

public class FieldResult extends Object

Purpose: Concrete class to represent the FieldResult structure as defined by the EJB 3.0 Persistence specification. This class is a subcompent of the EntityResult.

see
EntityResult
author
Gordon Yorke
since
TopLink Java Essentials

Fields Summary
protected String
attributeName
Stores the name of the bean attribute
protected String[]
multipleFieldIdentifiers
Stores passed in field name split on the '.' character
Vector
fieldResults
FieldResult now can contain multiple FieldResults in a collection if an attribute has multiple fields
protected String
columnName
Stores the Columns name from the result set that contains the attribute value
Constructors Summary
public FieldResult(String attributeName, String column)

        this.columnName = column;
        if (attributeName == null || this.columnName == null){
            throw new IllegalArgumentException(ExceptionLocalization.buildMessage("null_values_for_field_result"));
        }
        multipleFieldIdentifiers = attributeName.split("\\.",0);
        this.attributeName = multipleFieldIdentifiers[0];
    
Methods Summary
public voidadd(oracle.toplink.essentials.queryframework.FieldResult newFieldResult)
INTERNAL: This method is used to support mapping multiple fields, fields are concatenated/added to one fieldResult.

      if( fieldResults ==null){
          fieldResults = new java.util.Vector();
          fieldResults.add(this);
      }
      fieldResults.add(newFieldResult);
    
public java.lang.StringgetAttributeName()

        return this.attributeName;
    
public java.lang.StringgetColumnName()

        return this.columnName;
    
public java.util.VectorgetFieldResults()
INTERNAL:

        return fieldResults;
    
public java.lang.String[]getMultipleFieldIdentifiers()
INTERNAL:

        return multipleFieldIdentifiers;
    
public java.lang.ObjectgetValueFromRecord(oracle.toplink.essentials.sessions.DatabaseRecord record)
INTERNAL: This method is a convience method for extracting values from Results

        return record.get(this.columnName);