[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2907) ability to apply 'generation strategy' to generated properties
Steve Ebersole (JIRA)
noreply at atlassian.com
Wed Oct 28 12:57:15 EDT 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole updated HHH-2907:
--------------------------------
Fix Version/s: (was: 3.5)
3.6
This is not going into 3.5
> ability to apply 'generation strategy' to generated properties
> --------------------------------------------------------------
>
> Key: HHH-2907
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2907
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.6
>
>
> Currently, the support for generated properties allows only for db-generated values (ala triggers etc). Would be great to allow the user to provide a seperate (optional) strategy for generating the generated values.
> It would be nice to have a generic solution, which we can build on top of for the more common use cases. Also, we may need to use a name other than 'generated' in the annotations to avoid conflicts with the current @Generated annotation; for now lets use the term @Dynamic.
> Consider mapping a 'created timestamp' column. Currently, provided we are using a trigger, that would look like:
> @Generated(INSERT) Date created;
> The strategy here (^^) is implicitly 'db', as the db is taking care of the generation. In the most generic form, that could be written as:
> @Dynamic(time=INSERT,strategy=DB) Date created;
> Additionally, since this is such a common case, also allow this:
> @CreationTimestamp Date created;
> The final form would also allow the definition of strategies. As an example, consider:
> @CreationTimestamp(strategy=NOW) Date created;
> Here we are not relying on the db to generate the value, but are explicitly telling Hibernate to do it (basically 'use the current timestamp to generate a value here whenever we do an insert').
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list