/** * INTERNAL: * Retrieve the value for the field. If missing DatabaseRow.noEntry is returned. */ public Object getIndicatingNoEntry(DatabaseField key) { // PERF: Direct variable access. // Optimize check. int index = key.getIndex(); if ((index >= 0) && (index < this.fields.size())) { DatabaseField field = (DatabaseField)this.fields.elementAt(index); if ((field == key) || field.equals(key)) { return this.values.elementAt(index); } } index = this.fields.indexOf(key); if (index >= 0) { // PERF: If the fields index was not set, then set it. if (key.getIndex() == -1) { key.setIndex(index); } return this.values.elementAt(index); } else { return oracle.toplink.essentials.internal.sessions.AbstractRecord.noEntry; } }
/** * Reset the field's name and table from the qualified name. */ public void resetQualifiedName(String qualifiedName) { setIndex(-1); int index = qualifiedName.lastIndexOf('.'); if (index == -1) { setName(qualifiedName); getTable().setName(""); getTable().setTableQualifier(""); } else { setName(qualifiedName.substring(index + 1, qualifiedName.length())); getTable().setPossiblyQualifiedName(qualifiedName.substring(0, index)); } }
/** * The field name on the reference table is initialized and cached. */ protected void initializeDirectField(AbstractSession session) throws DescriptorException { if (getDirectField() == null) { throw DescriptorException.directFieldNameNotSet(this); } getDirectField().setTable(getReferenceTable()); getDirectField().setIndex(0); }
/** * The field name on the reference table is initialized and cached. */ protected void initializeDirectKeyField(AbstractSession session) throws DescriptorException { if (getDirectKeyField() == null) { throw DescriptorException.directFieldNameNotSet(this); } getDirectKeyField().setTable(getReferenceTable()); getDirectKeyField().setIndex(1); }
field.setIndex(index);