title: Spring: declare variable XML in java class and populateDatabase
body: <p>I want to introduce a String variable in my domain model. The contents of the variable will be an xml text, and that's where the question arises.</p>
  
  <p>I want to enter the string variable in my Bpmsn class:</p>
  
  <pre><code>@Entity
  @Access(AccessType.PROPERTY)
  public class Bpmsn extends DomainEntity {
  
  // Attributes ---------------------------------------------------------
  private String ticker;
  private String title;
  private String summary;
  private Date authoredMoment;
  private boolean public_;
  private int likes;      //Derived
  private int dislikes;   //Derived
  
  
  @NotBlank
  @NotNull
  @Pattern(regexp = "^(\\d{6})\\-([a-zA-Z]{4})$")
  @Column(unique=true)
  @SafeHtml
  public String getTicker() {
      return ticker;
  }
  
  public void setTicker(String ticker) {
      this.ticker = ticker;
  }
  
  @NotBlank
  @NotNull
  @SafeHtml
  public String getTitle() {
      return title;
  }
  
  public void setTitle(String title) {
      this.title = title;
  }
  
  @NotBlank
  @NotNull
  @SafeHtml
  public String getSummary() {
      return summary;
  }
  
  public void setSummary(String summary) {
      this.summary = summary;
  }
  
  @NotNull
  @Past
  @Temporal(TemporalType.TIMESTAMP)
  @DateTimeFormat(pattern="dd/MM/yyyy HH:mm")
  public Date getAuthoredMoment() {
      return authoredMoment;
  }
  
  public void setAuthoredMoment(Date authoredMoment) {
      this.authoredMoment = authoredMoment;
  }
  
  public boolean getIsPublic_() {
      return public_;
  }
  
  public void setIsPublic_(boolean public_) {
      this.public_ = public_;
  }
  
  @Min(0)
  public int getLikes() {
      return likes;
  }
  public void setLikes(int likes){
      this.likes = likes;
  }
  
  @Min(0)
  public int getDislikes() {
      return dislikes;
  }
  public void setDislikes(int dislikes){
      this.dislikes = dislikes;
  }
  </code></pre>
  
  <p>The first question is if I need any annotation of type @XML ....</p>
  
  <pre><code>private String textXML;
  
  public String getTextXML() {
    return textXML;
  }
  
  public void setTextXML(String textXML) {
    this.textXML = textXML;
  }
  </code></pre>
  
  <p>Once finished with this I need to enter some data in the database to do tests. 
  To do this I use the file PopulateDatabase.xml provided by Spring. My other question is how to declare a String attribute with xml text in the PopulateDatabase.xml file that looks like:</p>
  
  <pre><code>&lt;bean id="bpmsn1" class="domain.Bpmsn"&gt;
      &lt;property name="ticker" value="161018-aaaa" /&gt;
      &lt;property name="title" value="Test" /&gt;
      &lt;property name="summary" value="Testeando un poco" /&gt;
      &lt;property name="authoredMoment" value="10/18/2016 13:45" /&gt;
      &lt;property name="likes" value="2" /&gt;
      &lt;property name="dislikes" value="0" /&gt;
      &lt;property name="user" ref="user1" /&gt;
      &lt;property name="isPublic_" value="true" /&gt;
      &lt;property name="opinions"&gt;
          &lt;list&gt;
              &lt;ref bean="opinion1" /&gt;
              &lt;ref bean="opinion2" /&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="comments"&gt;
          &lt;list&gt;
              &lt;ref bean="comment2" /&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>That's how it goes wrong</p>
  
  <pre><code>&lt;property name="textXML" value="
    &lt;?xml%20version='1.0'%20encoding='UTF-8'?&gt;
    &lt;note&gt;
     &lt;to&gt;Tove&lt;/to&gt;
     &lt;from&gt;Jani&lt;/from&gt;
     &lt;heading&gt;Reminder&lt;/heading&gt;
     &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
    &lt;/note&gt;
   "&gt;
  </code></pre>