It passes validation effectively with nature = Nature.VIEW_MODEL indicating (as much as I can see) that the view model belongs to the application layer.

But using

   nature = Nature.INMEMORY_ENTITY or
   nature = Nature.EXTERNAL_ENTITY

to indicate that the view model is just a proxy for other domain objects in the domain layer generates this validation error:

   ... has multiple incompatible annotations/interfaces indicating that
   it is a recreatable object of some sort
   (RecreatableObjectFacetForDomainObjectAnnotation and
   RecreatableObjectFacetForXmlRootElementAnnotation)

So, I don't know how to specify that a jaxb view model is - say - a proxy for an external entity as I can do with legacy view models.



Am 20.10.2017 um 13:22 schrieb Jeroen van der Wal:
This is how I use it:

@DomainObject(nature = Nature.VIEW_MODEL, objectType = "MyJaxbViewModel")
@XmlRootElement(name = "myJaxbViewModel")
@XmlType(
         propOrder = {
             "myIncludedProperty"
         }
)
@XmlAccessorType(XmlAccessType.FIELD)
public class MyJaxbViewModel {

     @Getter @Setter @Nullable
     private String myIncludedProperty;

     @Getter @Setter @Nullable
     private String myIncludedProperty;

     @XmlTransient
     private String myExcludedProperty;

}

HTH


On 20 October 2017 at 12:28, Patrick Pliessnig <[email protected]> wrote:

Hi

Modeling a JAXB view model with @XmlRootElement and its nature with
@DomainObject( nature = ... ) does not pass metamodel validation.

Is there way to indicate the nature of a JAXB view model?
Eg. whether it belongs to the domain model or the application layer.

thx
Patrick


Reply via email to