“Data too long for column” - why?

前端 未结 12 680
Happy的楠姐
Happy的楠姐 2020-12-12 19:47

I\'ve written a MySQL script to create a database for hypothetical hospital records and populate it with data. One of the tables, Department, has a column named Description,

12条回答
  •  春和景丽
    2020-12-12 20:11

    With Hibernate you can create your own UserType. So thats what I did for this issue. Something as simple as this:

        public class BytesType implements org.hibernate.usertype.UserType {
    
             private final int[] SQL_TYPES = new int[] { java.sql.Types.VARBINARY };
         //...
        }
    

    There of course is more to implement from extending your own UserType but I just wanted to throw that out there for anyone looking for other methods.

提交回复
热议问题