Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate String Mapping

 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a string field in my database. Hibernate is mapping it as VARCHAR(255), but I need to store more data than that. Is there a way to tell Hibernate to use the database max? I've found ways to do it in annotations, but I'm using the xml files.

Oh, and I'm currently running on postgres with a possible port to oracle.
 
Fred Muhlenberg
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'd set the property "length" value to be equal to your database column length definition.

In Oracle, you have to specify your VARCHAR2 length at creation time.

-Fred
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic