About performing SQL queries with Hibernate, the character field type only returns the first byte of an issue

Source: Internet
Author: User

About performing SQL queries with Hibernate, the character field type only returns the first byte of an issue

Today, I encountered a problem, that is, in hibernate, I use SQL to query the MySQL database inside the user table inside the username field, but found that the data are only the first word, For example: In the user table inside the username field has a data is: "Chen Chiwei", the query returned after the result is the first letter of the data: "C"; So, I looked at the user this table design, found that the type of username this field is ' Char ' type, the query data returns to normal after it is changed to a varchar type.

This problem is not displayed in the command console of the database, I found it in Hibernate's SQL query, and I haven't tried it yet.

About performing SQL queries with Hibernate, the character field type only returns the first byte of an issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.