I have a question about how to Hibernate save arraylist of string(or object). I read here, so they said Hibernate will try call to toString method of arraylist to persist it.
I wrote a small code for test that, but it's not working like what they said.
class CustomizeArrayList extends ArrayList<String>
private static final long serialVersionUID = 1L;
@Override
public String toString() {
// TODO Auto-generated method stub
System.out.println("To String of customize arraylist");
return super.toString();
}
}
I'm using this type as so:
@Column("array")
private CustomizrArrayList array
It's not calling toString method, is it using reflection to persist or serialization rather or anything else?
Thanks in advance!