You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Savva Kolbachev (JIRA)" <ji...@apache.org> on 2015/03/17 15:17:38 UTC

[jira] [Closed] (CAY-1991) More control over generated String property names

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

Savva Kolbachev closed CAY-1991.
--------------------------------
       Resolution: Done
    Fix Version/s: 4.0.M3

> More control over generated String property names
> -------------------------------------------------
>
>                 Key: CAY-1991
>                 URL: https://issues.apache.org/jira/browse/CAY-1991
>             Project: Cayenne
>          Issue Type: Task
>    Affects Versions: 4.0.M2
>            Reporter: Andrus Adamchik
>            Assignee: Savva Kolbachev
>             Fix For: 4.0.M3
>
>
> In 4.0 for each persistent property we are generating a pair of static values in the _ class. E.g.:
>     @Deprecated
>     public static final String TITLE_PROPERTY = "title";
>     [..]
>     public static final Property<String> TITLE = new Property<String>("title");
> Deprecated tag on String property was intended to show users that Property object should be used instead. This is good and explicit for migrating existing code to the new API, but there are few reasons why we might want to rethink this strategy:
> * brand new code would get all the deprecated stuff all the same
> * sometimes static String property names are actually needed. E.g. to use as custom annotation parameters. It is impossible to use Property objects for annotations, and using String constants generates compiler warning due to deprecation.
> I think the solution to that should be to stop adding @Deprecated annotation to String properties, but make String property names inclusion optional, controlled with "createPropertyNames" flag in cgen ("false" by default I guess - something to mention in UPGRADE.txt).
> Also a similar option should be available in CayenneModeler class generation dialog.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)