Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-2731

Allow injected services to have getters on them. This would allow entities to be annotated with @lombok.Data, removing some boilerplate.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.0.0-M5
    • 2.0.0-M8
    • Core
    • None

    Description

      we had an entity:

      @Data
      public class Organisation {
          ...
      
          @Inject CLockService clockService;
      }

      Attempting to render this in Wicket results in a stack trace, because we have made the getClockService() into a property:

      java.lang.IllegalArgumentExceptionDon't know how to create an ObjectMemento for a type with ObjectSpecification ObjectSpecificationDefault@3d53e732[class=org.apache.isis.core.runtimeservices.clock.ClockServiceDefault,type=MANAGED_BEAN_NOT_CONTRIBUTING,superclass=java.lang.Object]. All other strategies failed. Type is neither identifiable (isManagedBean() || isViewModel() || isEntity()), nor is a 'parented' Collection, nor has 'encodable' semantics, nor is (Serializable || Externalizable)org.apache.isis.commons.internal.exceptions._Exceptions#illegalArgument(_Exceptions.java:80)org.apache.isis.viewer.wicket.viewer.services.mementos.ObjectMementoWkt#init(ObjectMementoWkt.java:475)org.apache.isis.viewer.wicket.viewer.services.mementos.ObjectMementoWkt#<init>(ObjectMementoWkt.java:435)org.apache.isis.viewer.wicket.viewer.services.mementos.ObjectMementoWkt#createOrNull(ObjectMementoWkt.java:67)org.apache.isis.viewer.wicket.viewer.services.mementos.ObjectMementoServiceWicket#mementoForObject(ObjectMementoServiceWicket.java:80)org.apache.isis.viewer.wicket.model.models.ManagedObjectModel#setObject(ManagedObjectModel.java:91)org.apache.isis.viewer.wicket.model.models.ScalarPropertyModel#reset(ScalarPropertyModel.java:129)org.apache.isis.viewer.wicket.model.models.ScalarPropertyModel#<init>(ScalarPropertyModel.java:56)org.apache.isis.viewer.wicket.model.models.EntityModel#getPropertyModel(EntityModel.java:237)org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup#addPropertyToForm(PropertyGroup.java:204)org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup#buildGui(PropertyGroup.java:117)org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup#<init>(PropertyGroup.java:80) 

      Attachments

        Activity

          People

            Unassigned Unassigned
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: