File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate String Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Hibernate String Mapping" Watch "Hibernate String Mapping" New topic
Author

Hibernate String Mapping

Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
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

Joined: Jan 08, 2008
Posts: 39


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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hibernate String Mapping
 
Similar Threads
jdbc
hibernate mapping file..
hibernate class A containing a list of B
Hibernate - SQLGrammarException : could not get next sequence value
String[] to columns