This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi guys (and gals), I've a general question regarding setting Hibernate properties when using hibernate.cfg.xml. What are (if any) valid property names for not only the root element <hibernate-configuration> but for <session-factory> as well? In other words, I want to be able to set thehibernate.query.substitutions or the hibernate.jdbc.fetch_size values in my xml config file. Are they just the name of the property in hibernate.properties sans the "hibernate" prefix? For example:
I haven't been able to find any info on valid property names (the DTD wasn't helpful in this regard). I know that the API allows you to set properties programmatically after instantiation of a Configuration object, but I haven't been able to find any examples. Perhaps this is the rout I need to go, but again... what are valid property names?
My question here as well is if, as the javadoc states, "A new Configuration will use the properties specified in hibernate.properties by default" does the use of the constructor preclude me from using the values in hibernate.cfg.xml? At what point is are the properties for the Configuration object read? I assume it is on construction.... More than one question, but... I'm evaluating this and need to gain a greater understanding of it before I present my findings. THANKS! --BW [ December 19, 2003: Message edited by: Brian R. Wainwright ] [ December 19, 2003: Message edited by: Brian R. Wainwright ]
Brian R. Wainwright
Joined: Aug 12, 2003
From the Hibernate.org forum: net.sf.hibernate.cfg.Environment contains the keys of available properties.
does the use of the constructor preclude me from using the values in hibernate.cfg.xml? At what point are the properties for the Configuration object read? I assume it is on construction....
No, hibernate.properties is read once for the lifetime of the JVM hibernate.cfg.xml is read every single time you call configuration.configure(); properties are overriden except those considered as System level (see the reference guide). Have a look a the net.sf.hibernate.cfg package for more infos