Skip to content
Snippets Groups Projects
Commit c04dec67 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

ObjectRelationType Entity

parent ed8144bf
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 78 deletions
......@@ -3,7 +3,7 @@
<name>ObjectRelationType_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<titleProcess>%aditoprj%/entity/ObjectRelationType_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
......@@ -17,15 +17,11 @@
</dependencies>
</entityProvider>
<entityField>
<name>AB_OBJECTRELATIONTYPEID</name>
<valueProcess>%aditoprj%/entity/ObjectRelationType_entity/entityfields/ab_objectrelationtypeid/valueProcess.js</valueProcess>
<name>UID</name>
<valueProcess>%aditoprj%/entity/ObjectRelationType_entity/entityfields/uid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_TYPE</name>
<mandatory v="true" />
</entityField>
<entityField>
<name>OBJECT_TITLE</name>
<name>RELATION_TITLE</name>
</entityField>
<entityParameter>
<name>SourceObjectType_param</name>
......@@ -43,43 +39,16 @@
</entityParameter>
</children>
</entityProvider>
<entityField>
<name>RELATION_TYPE</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<fromClauseProcess>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>7399a9d5-2e0f-497b-a7db-d14d7ae09965</name>
<tableName>AB_OBJECTRELATIONTYPE</tableName>
<primaryKey>AB_OBJECTRELATIONTYPEID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>OBJECT_TYPE.value</name>
<expression>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/recordfieldmappings/object_type.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_OBJECTRELATIONTYPEID.value</name>
<expression>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/recordfieldmappings/ab_objectrelationtypeid.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_TITLE.value</name>
<expression>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/recordfieldmappings/object_title.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>RELATION_TYPE.value</name>
<expression>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/db/recordfieldmappings/relation_type.value/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/ObjectRelationType_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFields>
<element>UID.value</element>
<element>RELATION_TITLE.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.logging");
import("system.vars");
import("system.db");
import("system.result");
import("Sql_lib");
logging.log(vars.getString("$param.SourceObjectType_param"))
// TODO: SQL Condition
result.string("'" + vars.getString("$param.SourceObjectType_param") + "' = type2 where type2.AB_OBJECTRELATIONTYPEID <> type1.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = type1.RELATION_TYPE)");
\ No newline at end of file
import("system.result");
result.string("AB_OBJECTRELATIONTYPEID type1")
\ No newline at end of file
import("system.result");
result.string("type1.AB_OBJECTRELATIONTYPEID");
\ No newline at end of file
import("system.result");
result.string("type1.RELATION_TITLE");
\ No newline at end of file
import("system.result");
result.string("type1.OBJECT_TYPE");
\ No newline at end of file
import("system.result");
result.string("type1.RELATION_TYPE");
\ No newline at end of file
import("system.logging");
import("system.translate");
import("system.db");
import("system.result");
import("system.vars");
logging.log(vars.get("$param.SourceObjectType_param"))
result.object(db.table(
["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE \n\
from AB_OBJECTRELATIONTYPE main \n\
left join AB_OBJECTRELATIONTYPE type2 on (type2.AB_OBJECTRELATIONTYPEID <> main.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = main.RELATION_TYPE) \n\
where case when type2.OBJECT_TYPE is null then ( ? = main.OBJECT_TYPE) else ( ? = type2.OBJECT_TYPE) end"
, [
[vars.get("$param.SourceObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]],
[vars.get("$param.SourceObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]],
]]));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.OBJECT_TITLE"))
\ No newline at end of file
result.string(vars.get("$field.RELATION_TITLE"))
\ No newline at end of file
......@@ -124,14 +124,14 @@
</entityParameter>
<entityField>
<name>selectedObjectRelationTypeIdProxy</name>
<title>Relation type</title>
<title>Relationtype</title>
<possibleItemsProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/possibleItemsProcess.js</possibleItemsProcess>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/valueProcess.js</valueProcess>
<onValueChange>%aditoprj%/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>relationTypeProxy</name>
<title>Relation type</title>
<title>Relationtype</title>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/relationtypeproxy/valueProcess.js</valueProcess>
</entityField>
<entityField>
......
......@@ -2556,6 +2556,12 @@
<entry>
<key>New attribute</key>
</entry>
<entry>
<key>MQC</key>
</entry>
<entry>
<key>Relation type</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
<sqlModels>
......
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0">
<name>ObjectRelationType</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<entity>ObjectRelationType_entity</entity>
</neonContext>
......@@ -40,6 +40,11 @@
<entityField>Contracts</entityField>
<view>ContractFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>ab7d3db4-af9d-4903-b28a-6347f2512a54</name>
<entityField>ObjectRelations</entityField>
<view>ObjectRelationFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>39c98ccb-7f77-4df0-818f-1f302f69fec4</name>
<entityField>Attributes</entityField>
......@@ -50,10 +55,5 @@
<entityField>Salesprojects</entityField>
<view>SalesprojectFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>ab7d3db4-af9d-4903-b28a-6347f2512a54</name>
<entityField>ObjectRelations</entityField>
<view>ObjectRelationFilter_view</view>
</neonViewReference>
</children>
</neonView>
......@@ -156,7 +156,10 @@ ContextUtils.getNameSubselectSql = function(pContextIdDbField, pRowIdDbField)
ContextUtils.getNameSql = function(pContextId, pRowId)
{
var selectMap = ContextUtils._getSelectMap()
return SqlCondition.begin().andPrepare(selectMap[pContextId][1] + "." + selectMap[pContextId][2], pRowId).buildSql("select " + selectMap[pContextId][0] + " from " + selectMap[pContextId][1], "1=2");
if (selectMap[pContextId] != undefined)
return SqlCondition.begin().andPrepare(selectMap[pContextId][1] + "." + selectMap[pContextId][2], pRowId).buildSql("select " + selectMap[pContextId][0] + " from " + selectMap[pContextId][1], "1=2");
else
return "select 1 from person where 1=2";
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment