Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
53b0e464
Commit
53b0e464
authored
6 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
Preview und Doku
parent
733f3752
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/ObjectRelation_entity/ObjectRelation_entity.aod
+2
-0
2 additions, 0 deletions
entity/ObjectRelation_entity/ObjectRelation_entity.aod
entity/ObjectRelation_entity/documentation.adoc
+33
-29
33 additions, 29 deletions
entity/ObjectRelation_entity/documentation.adoc
with
35 additions
and
29 deletions
entity/ObjectRelation_entity/ObjectRelation_entity.aod
+
2
−
0
View file @
53b0e464
...
...
@@ -70,6 +70,8 @@
<entityProvider>
<name>
ObjectRelations
</name>
<fieldType>
DEPENDENCY_IN
</fieldType>
<targetContextField>
objectTypeProxy
</targetContextField>
<targetIdField>
rowIdProxy
</targetIdField>
<recordContainer>
db
</recordContainer>
<dependencies>
<entityDependency>
...
...
This diff is collapsed.
Click to expand it.
entity/ObjectRelation_entity/documentation.adoc
+
33
−
29
View file @
53b0e464
...
...
@@ -3,45 +3,49 @@ Object Relation
:toc2: left
:numbered:
(how it works currently 13.0
2
.2019)
(how it works currently 13.0
3
.2019)
There are two possible ways for Object Relations:
== How the ObjectRelation_entity works ==
The entity works with the AB_OBJECTRELATION and AB_OBJECTRELATIONTYPE db-tables.
* With the ObjectRelation_entity
* With separate entities like the ActivityLink_entity
The AB_OBJECTRELATIONTYPE defines which relations are possible.
It always defines one "side" of the relation. So for each relation you always need two of them and both have to be from the same RELATION_TYPE.
== Differences ==
Relations which use a custom entity are specific for one object.
e.g. in ActivityLink are only relations between "activity" and "something".
In ObjectRelation are relations between "something" and "something".
So for example if you would like to have a relation between a child and parent you need these two types:
The activityLink could also be implemented with ObjectRelation, but as there are many activities with many relations.
So it is better to use an extra db-table.
----
AB_OBJECTRELATIONTYPEID = UID_1
OBJECT_TYPE = Person
RELATION_TITLE = child of
RELATION_TYPE = TypeUID_1
SIDE = 1
== How the ObjectRelation_entity works ==
The entity works with the AB_OBJECTRELATION db-table.
and
An ObjectRelation always has two Objects which consists of an Object-type and an Object-rowid.
The object-type is the id of the context. Which you can get by ContextUtils.getCurrentContextId of the Context_lib for the current context.
The object-rowid is the id of the Object you want use. Normally it is the UID of the Object.
AB_OBJECTRELATIONTYPEID = UID_2
OBJECT_TYPE = Person
RELATION_TITLE = parent of
RELATION_TYPE = TypeUID_1
SIDE = 2
----
It provides the following providers:
Note that the RELATION_TYPE is the same.
* AnyObject
* BothObjects
* Object1
* Object2
AnyObject is for bidirectional relations and all relations which contain the given AnyObject..._params as Object1 or Object2 will be loaded.
BothObjects is for relations between two specific objects provided by Object(1|2)..._params.
Object1 is for unidirectional relations where the Object1 is provided as parameters.
Object2 is for unidirectional relations where the Object2 is provided as parameters.
If you create a new relation between two persons it looks like this:
For the lookups there are two Entities: Object_entity for the Object-rowids and Context_entity for the Object-type.
See the documentation for them.
----
AB_OBJECTRELATIONID = RelUID_1
OBJECT1_ROWID = UID_Lisa_Sommer
OBJECT2_ROWID = UID_Franz_Mueller
AB_OBJECTRELATIONTYPE1 = UID_1
AB_OBJECTRELATIONTYPE2 = UID_2
----
-> So:
The provider use the targetContext-feature to show the preview of the linked objects directly. (see targetContext-docu in the ohers/guide folder)
* Most relationtypes consist of two separate types connected by the RELATION_TYPE-id
* Each type also has a SIDE, which defines, if it is for side 1 or side 2
* If both sides are from the same type, then there is only one OBJECTRELATIONTYPE with the side 1 and Objects use the same one.
== Link-entities ==
They work very similar to the ObjectRelation, but only use one Object. The lookups and targetContext-feature work the same.
\ No newline at end of file
The provider use the targetContext-feature to show the preview of the linked objects directly. (see targetContext-docu in the ohers/guide folder)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment