cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-314) PK Generation Improvements
Date Sun, 28 Oct 2012 15:43:12 GMT

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

Andrus Adamchik closed CAY-314.
-------------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: Short term future)

we need something DI-based for PkGenerator customization... this will require a separate issue
though.
                
> PK Generation Improvements
> --------------------------
>
>                 Key: CAY-314
>                 URL: https://issues.apache.org/jira/browse/CAY-314
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 1.2 branch
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> [Supporting Arbitrary PK types at the Generator Level]
> We need to support at least "long" in addition to "int". I guess the good idea is to
generalize this and only use "Object" in the API. Another idea is to change generator method
signiture to take DbAttribute instead of DbEntity, as this will provide a way to determine
the type of the key.
> [Bootstrapping PK Generator]
>    
> void createAutoPk(DataNode node, List dbEntities);
> with 
> void createAutoPk(
>    DataNode node, 
>    List dbEntities, 
>    int defaultStartValue,
>    boolean checkCurrentValues);
> But this will only work if DbGenerator uses DataNode instead of raw SQL connection. Another
problem is that PkGenerator has a number of methods that simply return SQL code without running
it. This is useful for showing the users what will be executed (and also allows users to store
the script and run it later), however it limits the possibilities for encapsulation of PK
logic. ... 
> I guess we'll have to stick with providing a SQL solution that can be executed outside
of Cayenne (e.g. PL/SQL for Oracle). Don't see a way around it. However sql-generation methods
of PkGenerator (and eventually DbAdapter) can be deprecated. Instead we should implement PKGenerators
via SQLTemplates. Then we can run such SQLTemplate in two modes - "normal" for actual generation
and "mock" for text SQL script output. This may depend on CAY-304 feature.
> This should provide new capabilities and make DbAdapter/PKGenerator API simpler and much
more consistent. 
>    

--
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

Mime
View raw message