1 21 package oracle.toplink.essentials.queryframework; 23 24 25 import oracle.toplink.essentials.internal.localization.ExceptionLocalization; 26 import oracle.toplink.essentials.sessions.DatabaseRecord; 27 28 38 39 public class FieldResult { 40 41 protected String attributeName; 42 43 protected String [] multipleFieldIdentifiers; 44 45 java.util.Vector fieldResults; 46 47 48 protected String columnName; 49 50 public FieldResult(String attributeName, String column){ 51 this.columnName = column; 52 if (attributeName == null || this.columnName == null){ 53 throw new IllegalArgumentException (ExceptionLocalization.buildMessage("null_values_for_field_result")); 54 } 55 multipleFieldIdentifiers = attributeName.split("\\.",0); 56 this.attributeName = multipleFieldIdentifiers[0]; 57 } 58 59 public String getAttributeName(){ 60 return this.attributeName; 61 } 62 63 public String getColumnName(){ 64 return this.columnName; 65 } 66 67 71 public Object getValueFromRecord(DatabaseRecord record){ 72 return record.get(this.columnName); 73 } 74 75 78 public java.util.Vector getFieldResults(){ 79 return fieldResults; 80 } 81 82 85 public String [] getMultipleFieldIdentifiers(){ 86 return multipleFieldIdentifiers; 87 } 88 89 94 public void add(FieldResult newFieldResult){ 95 if( fieldResults ==null){ 96 fieldResults = new java.util.Vector (); 97 fieldResults.add(this); 98 } 99 fieldResults.add(newFieldResult); 100 } 101 102 } 103 | Popular Tags |