This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 025d327b7f ISIS-3270: have BeanTypeClassifier recognize JAXB viewmodels
025d327b7f is described below

commit 025d327b7fbfbd0a1637d4627f30c3c7c792326a
Author: Andi Huber <[email protected]>
AuthorDate: Thu Nov 3 08:12:16 2022 +0100

    ISIS-3270: have BeanTypeClassifier recognize JAXB viewmodels
---
 .../core/config/beans/CausewayBeanTypeClassifierDefault.java        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifierDefault.java
 
b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifierDefault.java
index 8a35310702..36f53d989c 100644
--- 
a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifierDefault.java
+++ 
b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifierDefault.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.lang.reflect.Modifier;
 
 import javax.persistence.Entity;
+import javax.xml.bind.annotation.XmlRootElement;
 
 import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
@@ -159,6 +160,11 @@ implements CausewayBeanTypeClassifier {
             }
         }
 
+        val jaxbAnnotation = _Annotations.synthesize(type, 
XmlRootElement.class).orElse(null);
+        if(jaxbAnnotation!=null) {
+            return CausewayBeanMetaData.causewayManaged(BeanSort.VIEW_MODEL, 
type);
+        }
+
         if(_Annotations.isPresent(type, Component.class)) {
             return 
CausewayBeanMetaData.indifferent(BeanSort.MANAGED_BEAN_NOT_CONTRIBUTING, type);
         }

Reply via email to