facebook

add properties to hibernate.cfg.xml

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #224530 Reply

    slackorama
    Member

    How do I add properties to the hibernate.cfg.xml after I have used ME to create it.

    I want to add in a connection pool and turn on show_sql. Should I just create a hibernate.properties file and let the xml file over-ride what’s in that file?

    Thanks in advance.

    #224553 Reply

    support-jeff
    Member

    dear slack –

    Currently, the only way to add properties after generating the config file is to do it manually (beware that adding mappings regens the config file and whacks your changes), or just whack the original config file and create a new one (use New -> Other -> J2EE -> Hibernate 2.1 -> Hibernate Config File) – just remember to add your mapping files into the config file at that time.

    Not sure if the hib.properties thing would work or not – is this a Hibernate feature?

    #224587 Reply

    slackorama
    Member

    Thanks for getting back to me. Yeah, I found out the hard way that new mappingss kill your changes.

    Not sure if the hib.properties thing would work or not – is this a Hibernate feature?

    Yeah, the hibernate.cfg.xml file overrides values set in hibernate.properties.
    http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html#configuration-xmlconfig

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: add properties to hibernate.cfg.xml

You must be logged in to post in the forum log in