在mapping文件中设置了character的长度为6,但是生成表的时候CHAR长度却为1.
同样设置的string的长度在生成表时是有效果的,代码如下:
<property name="curl" length="6" not-null="true" type="character"/>
<property name="officialshop" length="60" not-null="true" type="string"/>
生成表时:
`curl` CHAR(1) NOT NULL,
`officialshop` VARCHAR(60) NOT NULL,
不论把length="6"的值改成多少,生成表时都是 CHAR(1).
hibernate character string java curl
------解决方案--------------------
Character 类在对象中包装一个基本类型 char 的值。Character 类型的对象包含类型为 char 的单个字段。