You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Arseni Bulatski (JIRA)" <ji...@apache.org> on 2018/10/16 16:57:00 UTC

[jira] [Updated] (CAY-2488) Problem with not to PK relationships

     [ https://issues.apache.org/jira/browse/CAY-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arseni Bulatski updated CAY-2488:
---------------------------------
    Description: 
Problem with not to PK relationships was found.
 * create relationship with join not to PK (target or source attribute isn't PK) in modeler
 * create entities
 * create relationship between entities
 * commit changes

In database objects will be created, but relationship won't be created. So you can't be able to get joined objects.

This happens because in you can't create arcDiff.

Look DataDomainDBDiffBuilder arcCreated method and appendForeignKeys method.

In current logic you can get only PK attribute value from ObjectId.

First step is to add validation of this case to prevent user to create this kind of relationship.

  was:
Problem with not to PK relationships was found.
 * create relationship with join not to PK (target or source attribute isn't PK) in modeler
 * create entities
 * create relationship between entities
 * commit changes

In database objects will be created, but relationship won't be created. So you can't be able to get joined objects.

This happens because in you can't create arcDiff.

Look DataDomainDBDiffBuilder

if (!relationship.isToMany() && relationship.isToPK()) {
 doArcCreated(targetNodeId, arcId);
}

In current logic you can get only PK attribute value from ObjectId.

First step is to add validation of this case to prevent user to create this kind of relationship.


> Problem with not to PK relationships
> ------------------------------------
>
>                 Key: CAY-2488
>                 URL: https://issues.apache.org/jira/browse/CAY-2488
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>            Reporter: Arseni Bulatski
>            Priority: Major
>             Fix For: 4.2.M1
>
>
> Problem with not to PK relationships was found.
>  * create relationship with join not to PK (target or source attribute isn't PK) in modeler
>  * create entities
>  * create relationship between entities
>  * commit changes
> In database objects will be created, but relationship won't be created. So you can't be able to get joined objects.
> This happens because in you can't create arcDiff.
> Look DataDomainDBDiffBuilder arcCreated method and appendForeignKeys method.
> In current logic you can get only PK attribute value from ObjectId.
> First step is to add validation of this case to prevent user to create this kind of relationship.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)