cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Savva Kolbachev (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1991) More control over generated String property names
Date Tue, 17 Mar 2015 14:17:38 GMT

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

Mime
View raw message