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

Ben Groeneveld (JIRA) noreply at atlassian.com
Thu Apr 23 13:31:17 EDT 2009


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

Ben Groeneveld commented on HHH-1873:
-------------------------------------

Yes, understand the problem (the compiler is following the non-intuitive spec) and am suggesting a permanent workaround.  For example, I have come across this pattern as a solution.  Maybe it will work for you.

public static class StaticFinals {
    public static String dynamic(String s) { return s; }
    public static int dynamic(int i) { return i; }
    // TODO implement methods for each primitive type
  }
 
  public static class ExampleProgram {
    public static final String MY_STATIC_STRING = StaticFinals.dynamic("Might change");
    public static final int MY_STATIC_INT = StaticFinals.dynamic(42);   
  }

> 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