• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about hibernate built-in type "text"

 
Kobe Luo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is my configuration code :




When i use hbmddl to create the database table automatically, it throws a exception: BLOB/TEXT column 'content' in the specification without a key length

and when i remove not-null="true",it works ok

why i can't use not-null?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if you keep the not null in there and just add a length?

Mark
 
Kobe Luo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i don't know why i should add length?
and why i can't add not-null???
Please explain!
Thank you
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error probably has more to do with MySQL (which i guess you are using) than Hibernate. A google search for that error string led me to some MySQL documentation and articles. One of them is this
 
Kobe Luo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jaikiran Pai very much!!!
You gave me what I want!
I use MySQL indeed!

Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic