[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1873) Query the hibernate version through the API

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Apr 23 13:20:17 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33003#action_33003 ] 

Steve Ebersole commented on HHH-1873:
-------------------------------------

That's what the Java compiler does in terms of static fields.  

Even adding a method  on Environment will *not* suffice if  by that you mean something like:
public static String getVersion() {
    return VERSION;
}
My (limited) testing showed that compilers were smart enough to inline the value of VERSION into the caller of getVersion() in these cases as well.

AFAIK, the only real option around that here is to have a non-static definition of the version, the question being from where to make that available.

Of course in the interim you ca n use reflection  to get this value which would be safe from compiler inlining...


> Query the hibernate version through the API
> -------------------------------------------
>
>                 Key: HHH-1873
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1873
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core
>            Reporter: Mark Grand
>            Priority: Minor
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> I am building a tool that will work with hibernate. Though this tool will be used with hibernate, I want it to work with whatever version of hibernate my users select. Making this work with future versions of hibernate will be eaiser if there is something in the API that says what the version of hibernate is.

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