Results 1 to 6 of 6

Thread: Hibernat + Sping - How to get the Dialect property?

  1. #1

    Default Hibernat + Sping - How to get the Dialect property?

    I am wondering if there is an elegant way to get Hibernate Dialect property (basically I want to find what type of DB, mysql, ms sql, postgresql, etc. it is using ). Based on the dialect info, I'll write some native SQL to take advantage of DB-specific features using createSQLQuery.

    Currently I did not see a good way to do it. Spring did a good job to seal up SessionFactory. I also do not what to use appContext.getBean() for obvious reason.

    Any ideas?

  2. #2

    Default

    hmmm, I see LocalSessionFactoryBean has a public getConfiguration method.... but I am not quite sure how to get n instance of LocalSessionFactoryBean

  3. #3

    Default

    turns out that was easy - just do <ref bean="&#38;sessionFactory/>

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    <ref bean="&sessionFactory/>
    actually you have to do an "&amp;", i.e. escape the & inside the xml file as it represents a reserved char.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5

    Default

    costin u r right.

    I did post &_#_38; though ("_ " added to avoid html interpretion)

    This forum software filtered it out to just "&" - sounds like a bug for this forum software...

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Always use the quotes and the preview button. Try searching for &amp and you'll be surprized of what you will find.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •