8 Replies Latest reply on Aug 30, 2012 9:03 AM by Tomaz Cerar

    forcing specific type mapping/dialect for datasource

    Markus Lutum Novice

      In the past for Jboss 4.2.3 we had this mssql-ds.xml in our deploy dir and there we defined the type mapping like this.

       

      <datasources>

        <local-tx-datasource>

           .....

          <type-mapping>MS SQLSERVER2000</type-mapping>

        </local-tx-datasource>

       

      As well as we set the property hibernate.dialect=XXXX

      at deploy\ejb3.deployer\META-INF\persistence.properties

       

      If I am not wrong this forced Hibernate to use the right dialect.

       

      How can I do the same with Jboss 7.1.1.

      I defined a module with my driver and use it inside my standalone.xml.

       

      Everything works perfect but there are special cases where I want to force hibernate to use a dialect.

       

      First one is the lack of autodetect SQLServer2010 dialect

      second: I have some issues with setMaxResults() on a query which maybe is not translated right to my current SQLServer 2008.

       

      So my question:

      How to force a dialect.

       

      Thx Markus Lutum