Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2907) ability to
apply 'generation strategy' to generated properties

Anupam M (JIRA)

2008-09-10


Author LoginPost Reply

  [ 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.3.1)
            3.3.x

> 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.3.x
>
>
> 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

   
_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.