You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Dzmitry Kazimirchyk (JIRA)" <ji...@apache.org> on 2011/08/19 11:56:27 UTC

[jira] [Updated] (CAY-1603) Improve custom ExtendedType registration API

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

Dzmitry Kazimirchyk updated CAY-1603:
-------------------------------------

    Attachment: extended-types.patch

Attaching patch that implements custom ExtendedType registration through DI. The patch itself may look large because of type renaming (ExtendedTypesMap class is now DefaultExtendedTypesMap and ExtendedTypesMap is now an interface).
This modification allows to configure custom ExtendedTypesMap in Module and then every DbAdapter adds types from this custom map to its own ExtendedTypesMap. It may seem complicated but every DbAdapter has its own database specific types which must be present in ExtendedTypesMap.

> Improve custom ExtendedType registration API
> --------------------------------------------
>
>                 Key: CAY-1603
>                 URL: https://issues.apache.org/jira/browse/CAY-1603
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M2
>            Reporter: Dzmitry Kazimirchyk
>         Attachments: extended-types.patch
>
>
> Cayenne's present custom ExtendedTypes registration seems a little bit uncomfortable:
> // Find DataNode
> DataDomain domain = runtime.getDataDomain();
> // replace 'node_name' with the name of the DataNode you've entered in the Modeler.
> DataNode node = domain.getNode("node_name");
> // install ExtendedType
> node.getAdapter().getExtendedTypes().registerType(customType);
> It will be good to have some more friendly API, which allows custom type registration without getting DataNode and DataDomain. Suppose this can be implemented with a help of DI.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira