• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to map String[ ](Array) mapping in Hibernate

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I got a table with a column
------------------------------------
Name of Field: MATCHING_CRITERIA
DataType: varchar
Length: 2000
------------------------------------

I am using mySQL 5.0. Now I have a bean which is as follows.



As you can see, there is a field matchingCriterionIDs as String[]. Now I want to store this field in column: MATCHING_CRITERIA in table as described top of this question.

Can we do it, if yes then how should I map this column with this String[].

Thanks for Reading
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just had Hibernate do a default mapping with a String array and found that Hiberante and the MySQL dialect mapped the String array to a TINYBLOB. Not what I expected.

-Cameron McKenzie
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic