The moose likes Object Relational Mapping and the fly likes Hibernate problem with persisting a List of Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate problem with persisting a List of Strings" Watch "Hibernate problem with persisting a List of Strings" New topic
Author

Hibernate problem with persisting a List of Strings

Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 147

Hey!

I ran into a small problem. I have an ArrayList<String>, which is annotated like this:



I put 40 Strings into it, each about 15 characters long, and when I try to save this, I get this error:



I tried googling for a solution, but I can't seem to find the right search terms for this.

I use Hibernate 4.2.7 and MySQL Connector 5.1.27 for this.

Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 147

I found the problem. I annotated both fields and getters, and that confused Hibernate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate problem with persisting a List of Strings