jTransfo 0.8 released

jTransfo 0.8 has been released.

There is only one change, but it is a big one.

All conversion methods now allow you to pass tags. These tags can be used when defining the mapping. Once a field has a @MapOnly annotation on it, the conversion will only occur if the annotation contains that tag. To allow different behaviour for different tags, you can put several MapOnly annotation on a field by combining them in a @MapOnlies annotation.

By default, the “*” tag is always prepended to the list of tags, so using a field declaration like

@MapOnlies({
        @MapOnly("create"),
        @MapOnly(value =  "*", readOnly = true)
})
private String somefield;

makes sure that the field is always read-only except when the “create” tag is passed, in which case the value will also be copied back to the domain object.

The MapOnly annotation can include readOnly and typeConverter parameters. If no type converter is specified on the MapOnly, then the type converter from the MappedBy annotation (if any- is used.

Posted in Release