You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Daniel Keir Haywood (Jira)" <ji...@apache.org> on 2021/06/10 16:13:00 UTC

[jira] [Commented] (ISIS-2731) Allow injected services to have getters on them. This would allow entities to be annotated with @lombok.Data, removing some boilerplate.

    [ https://issues.apache.org/jira/browse/ISIS-2731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17361057#comment-17361057 ] 

Daniel Keir Haywood commented on ISIS-2731:
-------------------------------------------

The workaround is to annotate the injected service with @Getter(NONE) @Setter(NONE).

> Allow injected services to have getters on them.  This would allow entities to be annotated with @lombok.Data, removing some boilerplate.
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-2731
>                 URL: https://issues.apache.org/jira/browse/ISIS-2731
>             Project: Isis
>          Issue Type: Improvement
>          Components: Isis Core
>    Affects Versions: 2.0.0-M5
>            Reporter: Daniel Keir Haywood
>            Priority: Minor
>             Fix For: 2.0.0-M7
>
>
> we had an entity:
> {code:java}
> @Data
> public class Organisation {
>     ...
>     @Inject CLockService clockService;
> }{code}
> Attempting to render this in Wicket results in a stack trace, because we have made the getClockService() into a property:
> {code:java}
> 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) {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)