[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2019) Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto

Jason Pyeron (JIRA) noreply at atlassian.com
Mon Jun 11 13:33:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27211 ] 

Jason Pyeron commented on HHH-2019:
-----------------------------------

workaround solution...

Configuration conf =...;

Properties oldprops=conf.getProperties();
Properties newprops=new Properties();

for (Object o:oldprops.keySet()) if (!"hibernate.connection.datasource".equals(o)) newprops.setProperty(o.toString(), oldprops.getProperty(o.toString()));	

conf.setProperties(newprops);
conf.setProperty("hibernate.connection.driver_class", clazz);
conf.setProperty("hibernate.connection.url", url);
conf.setProperty("hibernate.connection.username", user);
conf.setProperty("hibernate.connection.password", pass);


> Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-2019
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019
>             Project: Hibernate3
>          Issue Type: Improvement
>         Environment: hibernate / annotations / hibernate.properties
>            Reporter: Dave E Martin
>            Priority: Minor
>
> It may occasionally be desirable to programmatically get rid of or override a property value, this is generally allowed for by the .setProperty method, however:
> Once hbm2ddl.auto is set to something, there is no way to unset it, or set it to a value which would be equivalent to its being unset (or its undocumented). There is no remove or unset, or deleteProperty, and also setting it to null does not work.
> Due to issues such as HHH-2018, it may be necessary to programmatically 'get rid of' hbm2ddl.auto even if the end user (or some other mechanism) has specified a value for it in an external hibernate.properties file (or other method of setting hibernate properties).

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