You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Michael Gentry (JIRA)" <ji...@apache.org> on 2013/05/23 18:00:21 UTC

[jira] [Commented] (CAY-504) Add "none" and "table-based" PK generation Strategies

    [ https://issues.apache.org/jira/browse/CAY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13665289#comment-13665289 ] 

Michael Gentry commented on CAY-504:
------------------------------------

To comment upon a very old issue/thread ...

This hit one of the developers here today.  He had a one-to-one relationship A<->B where the master record A's PK was supposed to be pushed to the dependent child B (and the appropriate "To Dep PK" checkbox *was* set in A's relationship tab).  However, B's PK Generation Strategy was set to Database-Generated instead of Default, therefore Cayenne didn't try to push A's PK into B.  Instead, it left the PK out completely (expecting MySQL to auto-generate the PK, I suppose) and the INSERT blew up because the table didn't have auto-increment for the PK turned on.  Even if the table had been created to auto-generate the PK, the PKs in A and B wouldn't have matched, so this would still be a failure.

A PK Generation strategy of None would make more sense here to me than Default, which implies to me the AUTO_PK_SUPPORT table should be used.

This was in 3.0.2, FWIW.

                
> Add "none" and "table-based" PK generation Strategies
> -----------------------------------------------------
>
>                 Key: CAY-504
>                 URL: https://issues.apache.org/jira/browse/CAY-504
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Modeler
>    Affects Versions: 1.2 branch
>            Reporter: Mike Kienenberger
>             Fix For: Undefined future
>
>
> Modeler "PK generation Strategy" should support "none" (no automatic pk generation) and "auto pk table" (default table-based database-independent AUTO_PK_TABLE generation).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira