private MissingDataHandler missingDataHandler() { return getTypeDataAccess().getDataAccess().getMissingDataHandler(); } }
int fieldPosition = fieldPathIndexes[fieldIdx][i]; ordinal = dataAccess.readOrdinal(ordinal, fieldPosition); dataAccess = (HollowObjectTypeDataAccess) dataAccess.getDataAccess().getTypeDataAccess(schema.getReferencedType(fieldPosition), ordinal); schema = dataAccess.getSchema();
public final HollowRecord getReferencedGenericRecord(String fieldName) { String referencedType = getSchema().getReferencedType(fieldName); if(referencedType == null) { try { HollowObjectSchema hollowObjectSchema = (HollowObjectSchema)getTypeDataAccess().getDataAccess().getMissingDataHandler().handleSchema(getSchema().getName()); referencedType = hollowObjectSchema.getReferencedType(fieldName); if(referencedType == null) return null; } catch(Exception e) { return null; } } int ordinal = getOrdinal(fieldName); if(ordinal == -1) return null; return GenericHollowRecordHelper.instantiate(getTypeDataAccess().getDataAccess(), referencedType, ordinal); }
break; case REFERENCE: fieldValue = effigy(typeDataAccess.getDataAccess(), schema.getReferencedType(i), typeDataAccess.readOrdinal(effigy.ordinal, i));
private boolean fieldsAreEqual(HollowEffigy fromElement, HollowEffigy toElement, int[] fromFieldPath, int[] toFieldPath) { HollowObjectTypeDataAccess fromDataAccess = (HollowObjectTypeDataAccess) fromElement.getDataAccess(); int fromOrdinal = fromElement.getOrdinal(); HollowObjectTypeDataAccess toDataAccess = (HollowObjectTypeDataAccess) toElement.getDataAccess(); int toOrdinal = toElement.getOrdinal(); HollowObjectSchema fromSchema = fromDataAccess.getSchema(); HollowObjectSchema toSchema = toDataAccess.getSchema(); for (int i = 0; i < fromFieldPath.length - 1; i++) { int fromFieldPosition = fromFieldPath[i]; int toFieldPosition = toFieldPath[i]; fromOrdinal = fromDataAccess.readOrdinal(fromOrdinal, fromFieldPosition); toOrdinal = toDataAccess.readOrdinal(toOrdinal, toFieldPosition); fromDataAccess = (HollowObjectTypeDataAccess) fromDataAccess.getDataAccess().getTypeDataAccess(fromSchema.getReferencedType(fromFieldPosition)); toDataAccess = (HollowObjectTypeDataAccess) toDataAccess.getDataAccess().getTypeDataAccess(toSchema.getReferencedType(toFieldPosition)); fromSchema = fromDataAccess.getSchema(); toSchema = toDataAccess.getSchema(); } return HollowReadFieldUtils.fieldsAreEqual(fromDataAccess, fromOrdinal, fromFieldPath[fromFieldPath.length-1], toDataAccess, toOrdinal, toFieldPath[toFieldPath.length-1]); }
private int fieldHashCode(HollowEffigy element, int[] fieldPath) { HollowObjectTypeDataAccess dataAccess = (HollowObjectTypeDataAccess) element.getDataAccess(); HollowObjectSchema schema = dataAccess.getSchema(); int ordinal = element.getOrdinal(); for (int i = 0; i < fieldPath.length - 1; i++) { int fieldPosition = fieldPath[i]; ordinal = dataAccess.readOrdinal(ordinal, fieldPosition); dataAccess = (HollowObjectTypeDataAccess) dataAccess.getDataAccess().getTypeDataAccess(schema.getReferencedType(fieldPosition)); schema = dataAccess.getSchema(); } int fieldHash = HollowReadFieldUtils.fieldHashCode(dataAccess, ordinal, fieldPath[fieldPath.length-1]); return HashCodes.hashInt(fieldHash); }