class AsyncPackageDataModelOracleImpl implements AsyncPackageDataModelOracle {

    @Override
    public void getFieldCompletions(final String factType,
                                    final Callback<ModelField[]> callback) {
        final String fgcnByFactName = getFQCNByFactName(factType);
        ModelField[] fields = getModelFields(factType);

        if (fields == null || fields.length == 0) {
            fields = projectModelFields.get(fgcnByFactName);
            if (fields == null || isLazyProxy(fields)) {
                fields = null;
            } else {
                AsyncPackageDataModelOracleUtilities.correctModelFields(packageName,
                                                                        fields,
                                                                        imports);
            }
        }

        //Load incremental content
        if (fields == null || fields.length == 0) {
            service.call(new RemoteCallback<PackageDataModelOracleIncrementalPayload>() {

                @Override
                public void callback(final PackageDataModelOracleIncrementalPayload dataModel) {
                    AsyncPackageDataModelOracleUtilities.populateDataModelOracle(AsyncPackageDataModelOracleImpl.this,
                                                                                 dataModel);

                    // This will stop an infinite loop if there are no fields to be found
                    if (dataModel.getModelFields().get(fgcnByFactName) == null || dataModel.getModelFields().get(fgcnByFactName).length == 0) {
                        callback.callback(new ModelField[0]);
                    } else {
                        getFieldCompletions(factType,
                                            callback);
                    }
                }
            }).getUpdates(resourcePath,
                          imports,
                          fgcnByFactName);
        } else {
            callback.callback(fields);
        }
    }

    @Inject public  AsyncPackageDataModelOracleImpl(final Caller<IncrementalDataModelService> service,
                                           final Instance<DynamicValidator> validatorInstance);

}