Change apiJsonObjectToQRecord's includePrimaryKey param to be includeNonEditableFields instead

This commit is contained in:
2023-07-03 14:05:33 -05:00
parent 56b9738f15
commit 2bf611b24f
2 changed files with 8 additions and 7 deletions

View File

@ -124,7 +124,7 @@ public class QRecordApiAdapter
/*******************************************************************************
**
*******************************************************************************/
public static QRecord apiJsonObjectToQRecord(JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includePrimaryKey) throws QException
public static QRecord apiJsonObjectToQRecord(JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includeNonEditableFields) throws QException
{
////////////////////////////////////////////////////////////////////////////////
// make map of apiFieldNames (e.g., names as api uses them) to QFieldMetaData //
@ -164,9 +164,9 @@ public class QRecordApiAdapter
////////////////////////////////////////////////////////////////////////////////////////////////////////
if(!field.getIsEditable())
{
if(includePrimaryKey && field.getName().equals(table.getPrimaryKeyField()))
if(includeNonEditableFields)
{
LOG.trace("Even though field [" + field.getName() + "] is not editable, we'll use it, because it's the primary key, and we've been asked to include primary keys");
LOG.trace("Even though field [" + field.getName() + "] is not editable, we'll use it, because we've been asked to include non-editable fields");
}
else
{