activejdbcexport-to-xmljavalite

how to customize xml headers


I have a resultSet formed by:

LazyList<DeliveryLabel> deliveryLabels = DeliveryLabel.findBySQL(sql);
String wxml = deliveryLabels.toXml(true, true);

The xml generated start with:

<delivery_labels>
  <delivery_label>
    <data>
  </delivery_label>
</delivery_labels>

how to generate only:

<labels>
  <label>
    <data>
  </label>
</labels>

I´m can´t rename the class to Label.java, because it already exists in the project.

[]´s


Solution

  • Currently ActiveJDBC uses Inflections to pick names for XML tags. If you need custom tags or structure, you will have to implement a custom toXml() method.