Rollbase 3.0 OESO relationship data type error (Text vs Reco

Posted by mihai_neagoe on 05-Aug-2014 07:05

Hi,

I am checking the new Rollbase 3.0 on hosted cloud and I am trying to link two OE service objects.

If the objects are created using the same catalog (two temp-tables related in one dataset) the relation is created and works ok. Creating the objects with two separate catalog files and trying to create the relation using 'New OpenEdge Relationship' raises an error 

"Error: Types of selected PK and FK do not match"

The structure of the objects is:

objA: AId

objB: BId AId

The relation is made from objB to objA and the foreign key selected is AId (which has the same name and type as AId in objA).

Thank you.

All Replies

Posted by sedwin on 05-Aug-2014 07:18

Hi,

This error is shown when AId of objA and AId of objB are of different datatype.

For creating relationship between OESO created using different catalog, FK of objB should be of the same datatype as PK of objA.

Thanks,

Sopna.

Posted by mihai_neagoe on 05-Aug-2014 07:26

Hi Sopna,

In the example above both fields are character.

Posted by Bill Wood on 05-Aug-2014 07:51

WRT

> If the objects are created using the same catalog (two temp-tables related in one dataset)
> the relation is created and works ok. Creating the objects with two separate catalog files
> and trying to create the relation using 'New OpenEdge Relationship' raises an error 

This is an example of a Complex Dataset.   It is not just that the two temp-tables are in the same catalog.  It is about one REST resource, with one dataset that contains two related tables.
 
This pattern is supported by OpenEdge Business Entities, and OpenEdge Mobile, but it is not supported by Rollbase.
 
Rollbase (as specified in the documentation – see Creating Rollbase Objects from OpenEdge Services >> Limitations), ONLY supports resources with single tables.   (You can have more than one of these in the same catalog).   
 
This distinction has caused some issues in the past, so there is a plan to disallow importing these complex (dataset with multiple tables) resources.
 
You can enable 1-1 and 1-M relationships between two OE Service Objects (single-table in different datasets) with the new “Create OpenEdge Relationship” option.

 

Posted by mihai_neagoe on 05-Aug-2014 08:04

Hi Bill,

This is the scenario I am following:

objA is created from datasetA which contains only temptableA

objB is created from datasetB which contains only temptableB

The relation I want to create is 1-N between these two objects. The first example was using the two temp-tables in one dataset with defined relation in the dataset which works ok. For the second example I splitted the dataset into two datasets with one temp-table.

Posted by Bill Wood on 05-Aug-2014 09:00

WRT
>> The first example was using the two temp-tables in one dataset with
>> defined relation in the dataset which works ok.
 
The relationships are read in, but there are a lot of other issues with the complex dataset related to filtering, updating, deleting, and some read issues  (depending on the schema).  That is why this is ‘not a supported use case’.   The import of this dataset should be disabled.
 
WRT

>> objA is created from datasetA which contains only temptableA
>> objB is created from datasetB which contains only temptableB
>> The relation I want to create is 1-N between these two objects.

Assuming you want a 1-M (1 ObjA to Many ObjB) you just need to define the proper Foreign Key / Primary Key relationship.
ObjA needs a primary key (e.g. ttSalesRep.SaleRep).
ObjB needs a field that is the same datatype as ObjA’s Primary key (and is where the database stores the Foreign key value).  For example. oeCustomer.SalesRep (the names DO NOT need to match).
 
Step 1:
On the ‘Many’ side (ObjB = oeCustoemr), create a “New OpenEdge Relationship”
 
Step 2:
Choose the oeCustomer field (SalesRep) that matches the Primary Key of the other related OE Service Object.  In this case you want a oeCustomer.SalesRep to be the relationship to the ttSalesRep.SalesRep Primary key.
 
 
Step 3:
Select the appropriate link type (Many-1)
 

Posted by mihai_neagoe on 05-Aug-2014 09:45

Thank you for the answer. The problem appears when the PK field of objA is defined as Record Name as well. The datatype in Rollbase in this case is not 'Text' but 'Record Name'.

Selecting a different field as record name when creating the object solves this problem.

Posted by Bill Wood on 05-Aug-2014 11:31

>> The problem appears when the PK field of objA is defined as Record Name as well.
>>
The datatype in Rollbase in this case is not 'Text' but 'Record Name'.

Thanks for checking on what the issue is.   This may be a ‘usage pattern’ that was not considered when the feature was added.   Having the primary key as the Record Name is something that I think should work.   This might be a good enhancement to consider.

This thread is closed