cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dzmitry Kazimirchyk (JIRA)" <>
Subject [jira] [Updated] (CAY-1603) Improve custom ExtendedType registration API
Date Fri, 02 Sep 2011 15:24:09 GMT


Dzmitry Kazimirchyk updated CAY-1603:

    Attachment: extended-types.patch

Here is the patch that implements everything like you've described. But unfortunately it brokes
DbGeneratorTask from cayenne-tools and cdbgen, cdbimport from maven-cayenne-plugin. 
All of them need to create database adapter for their work, so they need to somehow pass extended
type lists to the adapter's constructor, but I can't find any possible way to do this. Another
workaround may be creating constructor with no params in each adapter which actually will
not load any extended types to the adapter's map.
Attaching patch to make sure that I haven't gone with this too far in a wrong direction.

> Improve custom ExtendedType registration API
> --------------------------------------------
>                 Key: CAY-1603
>                 URL:
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M2
>            Reporter: Dzmitry Kazimirchyk
>         Attachments: extended-types.patch, 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:


View raw message