From f1236ba929934e5fd995ad21753eaeba6162c088 Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Mon, 10 Aug 2020 17:22:24 +0200
Subject: [PATCH] Attribute_lib small refactoring

---
 process/Attribute_lib/process.js | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js
index 9fd2230221..23fb2e7385 100644
--- a/process/Attribute_lib/process.js
+++ b/process/Attribute_lib/process.js
@@ -1528,7 +1528,7 @@ AttributeRelationQuery.prototype.includeDisplayValue = function ()
 /**
  * Executes the query and returns the result, depending on the properties of the AttributeRelationQuery object.
  * 
- * @return {Object[]}               <p>
+ * @return {AttributeRelation[]}    <p>
  *                                  Array of objects. By default, the objects contain the properties:
  *                                  <ul>
  *                                  <li>attributeId</li>
@@ -1549,8 +1549,11 @@ AttributeRelationQuery.prototype.getAttributes = function ()
         "AB_ATTRIBUTE.ATTRIBUTE_NAME",
         "COMBOVAL.ATTRIBUTE_NAME",
         "AB_ATTRIBUTE.AB_ATTRIBUTEID",
-        "AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID"
+        "AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID",
+        "AB_ATTRIBUTERELATION.OBJECT_ROWID",
+        "AB_ATTRIBUTERELATION.OBJECT_TYPE"
     ];
+
     
     var valueFields = AttributeTypeUtil.getAllDatabaseFields();
 
@@ -1564,13 +1567,8 @@ AttributeRelationQuery.prototype.getAttributes = function ()
     
     var mappingFn = function (row)
     {
-        var attrObj = {
-            attributeId : row[4],
-            value : row[AttributeTypeUtil.getTypeColumnIndex(row[0]) + defaultFields.length],
-            attributeRelationId : row[5],
-            attributeName : row[2],
-            attributeType : row[0]
-        };
+        var attrObj = new AttributeRelation(row[5], row[4], row[AttributeTypeUtil.getTypeColumnIndex(row[0]) + defaultFields.length], 
+            row[2], row[0], row[6], row[7]);
         
         if (this._includeDisplayValue)
         {
@@ -1594,7 +1592,7 @@ AttributeRelationQuery.prototype.getAttributes = function ()
  * If this method is executed on your AttributeRelationQuery<br>
  * object it will return only one attribute.
  * 
- * @return {Object}             <p>
+ * @return {AttributeRelation}  <p>
  *                              Returns the AttributeRelationQuery object<br>
  *                              with only a sinlge attribute.<br>
  */
-- 
GitLab