No Dialect mapping for JDBC type: 1111





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







17















I'm working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded.



I'm running a mysql 5 instance. Here is a excerpt of my application.properties file:



spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect

spring.datasource.url=jdbc:mysql://localhost/mydatabase
spring.datasource.username=myuser
spring.datasource.password=SUPERSECRET
spring.datasource.driverClassName=com.mysql.jdbc.Driver


When executing an integration test, spring startsup properly but fails on creating the hibernate SessionFactory, with the exception:



org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111


I think my dialects should be Mysql5Dialect, I also tried the one explicitly stating InnoDB, and the two dialect options which don't indicate the version 5. But I always end up with the same 'No Dialect mapping for JDBC type: 1111' message.
My application.properties file resides in the test/resources source folder. It is recognized by the JUnit Test runner (I previously got an exception because of an typo in it).



Are the properties I'm setting wrong? I couldn't find some official documentation on these property names but found a hint in this stackoverflow answer: https://stackoverflow.com/a/25941616/1735497



Looking forward for your answers, thanks!



BTW The application is already using spring boot.










share|improve this question

























  • The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

    – SubOptimal
    Jan 28 '15 at 13:00











  • Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

    – SakeSushiBig
    Jan 28 '15 at 13:02











  • Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

    – SakeSushiBig
    Jan 28 '15 at 13:07











  • I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

    – giaffa86
    Mar 17 '17 at 17:10


















17















I'm working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded.



I'm running a mysql 5 instance. Here is a excerpt of my application.properties file:



spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect

spring.datasource.url=jdbc:mysql://localhost/mydatabase
spring.datasource.username=myuser
spring.datasource.password=SUPERSECRET
spring.datasource.driverClassName=com.mysql.jdbc.Driver


When executing an integration test, spring startsup properly but fails on creating the hibernate SessionFactory, with the exception:



org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111


I think my dialects should be Mysql5Dialect, I also tried the one explicitly stating InnoDB, and the two dialect options which don't indicate the version 5. But I always end up with the same 'No Dialect mapping for JDBC type: 1111' message.
My application.properties file resides in the test/resources source folder. It is recognized by the JUnit Test runner (I previously got an exception because of an typo in it).



Are the properties I'm setting wrong? I couldn't find some official documentation on these property names but found a hint in this stackoverflow answer: https://stackoverflow.com/a/25941616/1735497



Looking forward for your answers, thanks!



BTW The application is already using spring boot.










share|improve this question

























  • The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

    – SubOptimal
    Jan 28 '15 at 13:00











  • Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

    – SakeSushiBig
    Jan 28 '15 at 13:02











  • Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

    – SakeSushiBig
    Jan 28 '15 at 13:07











  • I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

    – giaffa86
    Mar 17 '17 at 17:10














17












17








17


1






I'm working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded.



I'm running a mysql 5 instance. Here is a excerpt of my application.properties file:



spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect

spring.datasource.url=jdbc:mysql://localhost/mydatabase
spring.datasource.username=myuser
spring.datasource.password=SUPERSECRET
spring.datasource.driverClassName=com.mysql.jdbc.Driver


When executing an integration test, spring startsup properly but fails on creating the hibernate SessionFactory, with the exception:



org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111


I think my dialects should be Mysql5Dialect, I also tried the one explicitly stating InnoDB, and the two dialect options which don't indicate the version 5. But I always end up with the same 'No Dialect mapping for JDBC type: 1111' message.
My application.properties file resides in the test/resources source folder. It is recognized by the JUnit Test runner (I previously got an exception because of an typo in it).



Are the properties I'm setting wrong? I couldn't find some official documentation on these property names but found a hint in this stackoverflow answer: https://stackoverflow.com/a/25941616/1735497



Looking forward for your answers, thanks!



BTW The application is already using spring boot.










share|improve this question
















I'm working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded.



I'm running a mysql 5 instance. Here is a excerpt of my application.properties file:



spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect

spring.datasource.url=jdbc:mysql://localhost/mydatabase
spring.datasource.username=myuser
spring.datasource.password=SUPERSECRET
spring.datasource.driverClassName=com.mysql.jdbc.Driver


When executing an integration test, spring startsup properly but fails on creating the hibernate SessionFactory, with the exception:



org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111


I think my dialects should be Mysql5Dialect, I also tried the one explicitly stating InnoDB, and the two dialect options which don't indicate the version 5. But I always end up with the same 'No Dialect mapping for JDBC type: 1111' message.
My application.properties file resides in the test/resources source folder. It is recognized by the JUnit Test runner (I previously got an exception because of an typo in it).



Are the properties I'm setting wrong? I couldn't find some official documentation on these property names but found a hint in this stackoverflow answer: https://stackoverflow.com/a/25941616/1735497



Looking forward for your answers, thanks!



BTW The application is already using spring boot.







java mysql spring hibernate jpa






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 12:18









Community

11




11










asked Jan 28 '15 at 12:42









SakeSushiBigSakeSushiBig

6312519




6312519













  • The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

    – SubOptimal
    Jan 28 '15 at 13:00











  • Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

    – SakeSushiBig
    Jan 28 '15 at 13:02











  • Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

    – SakeSushiBig
    Jan 28 '15 at 13:07











  • I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

    – giaffa86
    Mar 17 '17 at 17:10



















  • The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

    – SubOptimal
    Jan 28 '15 at 13:00











  • Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

    – SakeSushiBig
    Jan 28 '15 at 13:02











  • Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

    – SakeSushiBig
    Jan 28 '15 at 13:07











  • I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

    – giaffa86
    Mar 17 '17 at 17:10

















The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

– SubOptimal
Jan 28 '15 at 13:00





The error message means one column returns data in a type which cannot be mapped. No Dialect mapping for JDBC type: 1111 indicates java.sql.Types.OTHER`. What column types do you select from the table?

– SubOptimal
Jan 28 '15 at 13:00













Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

– SakeSushiBig
Jan 28 '15 at 13:02





Oh, thanks. I thought this means the dialect type ... Yeah I like to use UUIDs as IDs and we previously always worked with postgres, which has a UUID column type. So we could just say @Type(type="pg-uuid"); I don't think mysql has an UUID column type though

– SakeSushiBig
Jan 28 '15 at 13:02













Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

– SakeSushiBig
Jan 28 '15 at 13:07





Just found out it is very similar to postgres: apply @Type(type="uuid-char") annotation to the id attribute.

– SakeSushiBig
Jan 28 '15 at 13:07













I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

– giaffa86
Mar 17 '17 at 17:10





I have this problem if put on SELECT statement a json field. I use PostgresSQL and a custom hibernate field Type for json type.

– giaffa86
Mar 17 '17 at 17:10












7 Answers
7






active

oldest

votes


















13














Here the answer based on the comment from SubOptimal:



The error message actually says that one column type cannot be mapped to a database type by hibernate.
In my case it was the java.util.UUID type I use as primary key in some of my entities. Just apply the annotation @Type(type="uuid-char") (for postgres @Type(type="pg-uuid"))






share|improve this answer





















  • 1





    If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

    – Lu55
    Mar 23 '16 at 15:48











  • I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

    – Tim
    Nov 27 '16 at 12:13











  • Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

    – Ab Sin
    Mar 7 '17 at 8:54





















8














There is also another common use-case throwing this exception. Calling function which returns void. For more info and solution go here.






share|improve this answer

































    7














    Please Check if some Column return many have unknow Type in Query .



    eg : '1' as column_name can have type unknown



    and 1 as column_name is Integer is correct One .



    This thing worked for me.






    share|improve this answer



















    • 1





      I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

      – dwana
      Aug 7 '17 at 10:50











    • Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

      – jaskirat Singh
      Jul 2 '18 at 9:24





















    3














    Sometimes when you call sql procedure/function it might be required to return something. You can try returning void: RETURN; or string (this one worked for me): RETURN 'OK'






    share|improve this answer































      3














      I got the same error because my query returned a UUID column. To fix that I returned the UUID column as varchar type through the query like "cast(columnName as varchar)", then it worked.



      Example:



      public interface StudRepository extends JpaRepository<Mark, UUID> {

      @Modifying
      @Query(value = "SELECT Cast(stuid as varchar) id, SUM(marks) as marks FROM studs where group by stuid", nativeQuery = true)
      List<Student> findMarkGroupByStuid();

      public static interface Student(){
      private String getId();
      private String getMarks();
      }
      }





      share|improve this answer

































        0














        For anybody getting this error with an old hibernate (3.x) version:



        do not write the return type in capital letters. hibernate type implementation mapping uses lowercase return types and does not convert them:



        CREATE OR REPLACE FUNCTION do_something(param varchar)
        RETURNS integer AS
        $BODY$
        ...





        share|improve this answer































          0














          In my case the problem was that, I forgot to add resultClasses attribute when I setup my stored procedure in my User class.



          @NamedStoredProcedureQuery(name = "find_email",
          procedureName = "find_email", resultClasses = User.class, //<--I forgot that.
          parameters = {
          @StoredProcedureParameter(mode = ParameterMode.IN, name = "param_email", type = String.class)
          }),





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28192547%2fno-dialect-mapping-for-jdbc-type-1111%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            7 Answers
            7






            active

            oldest

            votes








            7 Answers
            7






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            13














            Here the answer based on the comment from SubOptimal:



            The error message actually says that one column type cannot be mapped to a database type by hibernate.
            In my case it was the java.util.UUID type I use as primary key in some of my entities. Just apply the annotation @Type(type="uuid-char") (for postgres @Type(type="pg-uuid"))






            share|improve this answer





















            • 1





              If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

              – Lu55
              Mar 23 '16 at 15:48











            • I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

              – Tim
              Nov 27 '16 at 12:13











            • Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

              – Ab Sin
              Mar 7 '17 at 8:54


















            13














            Here the answer based on the comment from SubOptimal:



            The error message actually says that one column type cannot be mapped to a database type by hibernate.
            In my case it was the java.util.UUID type I use as primary key in some of my entities. Just apply the annotation @Type(type="uuid-char") (for postgres @Type(type="pg-uuid"))






            share|improve this answer





















            • 1





              If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

              – Lu55
              Mar 23 '16 at 15:48











            • I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

              – Tim
              Nov 27 '16 at 12:13











            • Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

              – Ab Sin
              Mar 7 '17 at 8:54
















            13












            13








            13







            Here the answer based on the comment from SubOptimal:



            The error message actually says that one column type cannot be mapped to a database type by hibernate.
            In my case it was the java.util.UUID type I use as primary key in some of my entities. Just apply the annotation @Type(type="uuid-char") (for postgres @Type(type="pg-uuid"))






            share|improve this answer















            Here the answer based on the comment from SubOptimal:



            The error message actually says that one column type cannot be mapped to a database type by hibernate.
            In my case it was the java.util.UUID type I use as primary key in some of my entities. Just apply the annotation @Type(type="uuid-char") (for postgres @Type(type="pg-uuid"))







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 13 '17 at 11:02









            amir110

            391411




            391411










            answered Jan 28 '15 at 13:09









            SakeSushiBigSakeSushiBig

            6312519




            6312519








            • 1





              If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

              – Lu55
              Mar 23 '16 at 15:48











            • I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

              – Tim
              Nov 27 '16 at 12:13











            • Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

              – Ab Sin
              Mar 7 '17 at 8:54
















            • 1





              If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

              – Lu55
              Mar 23 '16 at 15:48











            • I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

              – Tim
              Nov 27 '16 at 12:13











            • Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

              – Ab Sin
              Mar 7 '17 at 8:54










            1




            1





            If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

            – Lu55
            Mar 23 '16 at 15:48





            If you get the exception only in test environment on HSQLDB - take a look at stackoverflow.com/questions/1007176/…

            – Lu55
            Mar 23 '16 at 15:48













            I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

            – Tim
            Nov 27 '16 at 12:13





            I agree with Lu55 . You should not add the @Type annotation until it is really necessary. But I don't really agree with the solutions provided in the linked issue (maybe they are just too old?). Therefore I create a post with my own solution: stackoverflow.com/questions/1007176/…

            – Tim
            Nov 27 '16 at 12:13













            Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

            – Ab Sin
            Mar 7 '17 at 8:54







            Or alternatively in your query string you can also do a Casting to Varchar like so: CAST( table_name.column_name as VARCHAR) AS table_name

            – Ab Sin
            Mar 7 '17 at 8:54















            8














            There is also another common use-case throwing this exception. Calling function which returns void. For more info and solution go here.






            share|improve this answer






























              8














              There is also another common use-case throwing this exception. Calling function which returns void. For more info and solution go here.






              share|improve this answer




























                8












                8








                8







                There is also another common use-case throwing this exception. Calling function which returns void. For more info and solution go here.






                share|improve this answer















                There is also another common use-case throwing this exception. Calling function which returns void. For more info and solution go here.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 23 '17 at 11:47









                Community

                11




                11










                answered May 31 '15 at 19:59









                icl7126icl7126

                2,03212932




                2,03212932























                    7














                    Please Check if some Column return many have unknow Type in Query .



                    eg : '1' as column_name can have type unknown



                    and 1 as column_name is Integer is correct One .



                    This thing worked for me.






                    share|improve this answer



















                    • 1





                      I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                      – dwana
                      Aug 7 '17 at 10:50











                    • Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                      – jaskirat Singh
                      Jul 2 '18 at 9:24


















                    7














                    Please Check if some Column return many have unknow Type in Query .



                    eg : '1' as column_name can have type unknown



                    and 1 as column_name is Integer is correct One .



                    This thing worked for me.






                    share|improve this answer



















                    • 1





                      I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                      – dwana
                      Aug 7 '17 at 10:50











                    • Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                      – jaskirat Singh
                      Jul 2 '18 at 9:24
















                    7












                    7








                    7







                    Please Check if some Column return many have unknow Type in Query .



                    eg : '1' as column_name can have type unknown



                    and 1 as column_name is Integer is correct One .



                    This thing worked for me.






                    share|improve this answer













                    Please Check if some Column return many have unknow Type in Query .



                    eg : '1' as column_name can have type unknown



                    and 1 as column_name is Integer is correct One .



                    This thing worked for me.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 5 '16 at 12:00









                    jaskirat Singhjaskirat Singh

                    449311




                    449311








                    • 1





                      I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                      – dwana
                      Aug 7 '17 at 10:50











                    • Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                      – jaskirat Singh
                      Jul 2 '18 at 9:24
















                    • 1





                      I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                      – dwana
                      Aug 7 '17 at 10:50











                    • Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                      – jaskirat Singh
                      Jul 2 '18 at 9:24










                    1




                    1





                    I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                    – dwana
                    Aug 7 '17 at 10:50





                    I had a native query with a my own SqlResultMapping and this was the problem, fixed it by adding a cast to the query ''CAST('staticstring' AS varchar(50)) as columnmappingname

                    – dwana
                    Aug 7 '17 at 10:50













                    Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                    – jaskirat Singh
                    Jul 2 '18 at 9:24







                    Yes, you have to use this CAST function within your QUERY to typecast into your appropriate DataType.

                    – jaskirat Singh
                    Jul 2 '18 at 9:24













                    3














                    Sometimes when you call sql procedure/function it might be required to return something. You can try returning void: RETURN; or string (this one worked for me): RETURN 'OK'






                    share|improve this answer




























                      3














                      Sometimes when you call sql procedure/function it might be required to return something. You can try returning void: RETURN; or string (this one worked for me): RETURN 'OK'






                      share|improve this answer


























                        3












                        3








                        3







                        Sometimes when you call sql procedure/function it might be required to return something. You can try returning void: RETURN; or string (this one worked for me): RETURN 'OK'






                        share|improve this answer













                        Sometimes when you call sql procedure/function it might be required to return something. You can try returning void: RETURN; or string (this one worked for me): RETURN 'OK'







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Sep 8 '15 at 11:56









                        Klapsa2503Klapsa2503

                        617728




                        617728























                            3














                            I got the same error because my query returned a UUID column. To fix that I returned the UUID column as varchar type through the query like "cast(columnName as varchar)", then it worked.



                            Example:



                            public interface StudRepository extends JpaRepository<Mark, UUID> {

                            @Modifying
                            @Query(value = "SELECT Cast(stuid as varchar) id, SUM(marks) as marks FROM studs where group by stuid", nativeQuery = true)
                            List<Student> findMarkGroupByStuid();

                            public static interface Student(){
                            private String getId();
                            private String getMarks();
                            }
                            }





                            share|improve this answer






























                              3














                              I got the same error because my query returned a UUID column. To fix that I returned the UUID column as varchar type through the query like "cast(columnName as varchar)", then it worked.



                              Example:



                              public interface StudRepository extends JpaRepository<Mark, UUID> {

                              @Modifying
                              @Query(value = "SELECT Cast(stuid as varchar) id, SUM(marks) as marks FROM studs where group by stuid", nativeQuery = true)
                              List<Student> findMarkGroupByStuid();

                              public static interface Student(){
                              private String getId();
                              private String getMarks();
                              }
                              }





                              share|improve this answer




























                                3












                                3








                                3







                                I got the same error because my query returned a UUID column. To fix that I returned the UUID column as varchar type through the query like "cast(columnName as varchar)", then it worked.



                                Example:



                                public interface StudRepository extends JpaRepository<Mark, UUID> {

                                @Modifying
                                @Query(value = "SELECT Cast(stuid as varchar) id, SUM(marks) as marks FROM studs where group by stuid", nativeQuery = true)
                                List<Student> findMarkGroupByStuid();

                                public static interface Student(){
                                private String getId();
                                private String getMarks();
                                }
                                }





                                share|improve this answer















                                I got the same error because my query returned a UUID column. To fix that I returned the UUID column as varchar type through the query like "cast(columnName as varchar)", then it worked.



                                Example:



                                public interface StudRepository extends JpaRepository<Mark, UUID> {

                                @Modifying
                                @Query(value = "SELECT Cast(stuid as varchar) id, SUM(marks) as marks FROM studs where group by stuid", nativeQuery = true)
                                List<Student> findMarkGroupByStuid();

                                public static interface Student(){
                                private String getId();
                                private String getMarks();
                                }
                                }






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Jan 4 at 16:45









                                biniam

                                6,25033646




                                6,25033646










                                answered Jan 3 at 6:16









                                RamyaRamya

                                312




                                312























                                    0














                                    For anybody getting this error with an old hibernate (3.x) version:



                                    do not write the return type in capital letters. hibernate type implementation mapping uses lowercase return types and does not convert them:



                                    CREATE OR REPLACE FUNCTION do_something(param varchar)
                                    RETURNS integer AS
                                    $BODY$
                                    ...





                                    share|improve this answer




























                                      0














                                      For anybody getting this error with an old hibernate (3.x) version:



                                      do not write the return type in capital letters. hibernate type implementation mapping uses lowercase return types and does not convert them:



                                      CREATE OR REPLACE FUNCTION do_something(param varchar)
                                      RETURNS integer AS
                                      $BODY$
                                      ...





                                      share|improve this answer


























                                        0












                                        0








                                        0







                                        For anybody getting this error with an old hibernate (3.x) version:



                                        do not write the return type in capital letters. hibernate type implementation mapping uses lowercase return types and does not convert them:



                                        CREATE OR REPLACE FUNCTION do_something(param varchar)
                                        RETURNS integer AS
                                        $BODY$
                                        ...





                                        share|improve this answer













                                        For anybody getting this error with an old hibernate (3.x) version:



                                        do not write the return type in capital letters. hibernate type implementation mapping uses lowercase return types and does not convert them:



                                        CREATE OR REPLACE FUNCTION do_something(param varchar)
                                        RETURNS integer AS
                                        $BODY$
                                        ...






                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Jan 18 '18 at 10:06









                                        AnubisAnubis

                                        38124




                                        38124























                                            0














                                            In my case the problem was that, I forgot to add resultClasses attribute when I setup my stored procedure in my User class.



                                            @NamedStoredProcedureQuery(name = "find_email",
                                            procedureName = "find_email", resultClasses = User.class, //<--I forgot that.
                                            parameters = {
                                            @StoredProcedureParameter(mode = ParameterMode.IN, name = "param_email", type = String.class)
                                            }),





                                            share|improve this answer




























                                              0














                                              In my case the problem was that, I forgot to add resultClasses attribute when I setup my stored procedure in my User class.



                                              @NamedStoredProcedureQuery(name = "find_email",
                                              procedureName = "find_email", resultClasses = User.class, //<--I forgot that.
                                              parameters = {
                                              @StoredProcedureParameter(mode = ParameterMode.IN, name = "param_email", type = String.class)
                                              }),





                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                In my case the problem was that, I forgot to add resultClasses attribute when I setup my stored procedure in my User class.



                                                @NamedStoredProcedureQuery(name = "find_email",
                                                procedureName = "find_email", resultClasses = User.class, //<--I forgot that.
                                                parameters = {
                                                @StoredProcedureParameter(mode = ParameterMode.IN, name = "param_email", type = String.class)
                                                }),





                                                share|improve this answer













                                                In my case the problem was that, I forgot to add resultClasses attribute when I setup my stored procedure in my User class.



                                                @NamedStoredProcedureQuery(name = "find_email",
                                                procedureName = "find_email", resultClasses = User.class, //<--I forgot that.
                                                parameters = {
                                                @StoredProcedureParameter(mode = ParameterMode.IN, name = "param_email", type = String.class)
                                                }),






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Mar 26 '18 at 11:51









                                                GaborHGaborH

                                                1792417




                                                1792417






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Stack Overflow!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28192547%2fno-dialect-mapping-for-jdbc-type-1111%23new-answer', 'question_page');
                                                    }
                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    MongoDB - Not Authorized To Execute Command

                                                    How to fix TextFormField cause rebuild widget in Flutter

                                                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith