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

Dave E Martin (JIRA) noreply at atlassian.com
Thu Aug 24 16:29:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019?page=comments#action_24075 ] 

Dave E Martin commented on HHH-2019:
------------------------------------

Setting it to null (which I did try) does not work.

Setting it to "none" apparently does work, however it is NOT DOCUMENTED (which is why I did not try). According to the 3.1.1 reference documentation (the latest that I see available at hibernate.org) the options are: validate, update, create, and create-drop. (but it says Eg, implying that there might be other values it can be, but they are not mentioned anywhere).

Elsewhere the documentation says:

"The hbm2ddl.auto option turns on automatic generation of database schemas - directly into the database. This can of course also be turned off (BY REMOVING THE CONFIG OPTION)"
(emphasis mine).

And yet elsewhere:
"Now disable hbm2ddl by commenting out the property in your hibernate.cfg.xml  file." (this section of the documentation appears to be unaware that there is a .auto or that it can do anything other than drop-create).

Setting it to "" apparently also works, however I interpreted the above phrases to mean that hbm2ddl.auto should not be present at all.

Setting it to "kasdjfghiowuerh" also works. Apparently setting it to any unrecognized value (except null) causes it to behave as if its not specified at all.

May I humbly suggest that it be properly documented and some sort of none or off option be formally recognized.

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