Hi,
I am trying to persist a string object in Mysql(5.0.67) using hibernate.
My entity is as follows:
@Entity
@Table(name = "info", schema = "DB")
public class info {
@Column(name = "InfoXml")
private String InfoXml;
}
The problem is when I persist the xml with value:
String InfoXml = "<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r\n<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\r\n<properties>\r\n<entry key="Hello">hi</entry>\r\n</properties>";
The DB table column shows the only value as:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
being persisted.
Rest of the xml is disappearing without a trace.
Investigating little more I found that any string that is containing '\r\n' (next line) is being persisted till the next line only and the rest of the string is not persisted.
What's happening here? and what is the workaround?
Thanks in advance
Ashish