You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/08/01 14:41:00 UTC

[jira] [Commented] (ISIS-2754) Use @AliasFor to declare Spring's @Named from @DomainService(logicalTypeName)

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

ASF subversion and git services commented on ISIS-2754:
-------------------------------------------------------

Commit f7704bec2e24d08d04409f09885aa73a3fbbf679 in isis's branch refs/heads/ISIS-2754 from danhaywood
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=f7704be ]

ISIS-2754: adds AliasFor to DomainService and DomainObject

for @Named and logicalTypeName; also objectType


> Use @AliasFor to declare Spring's @Named from @DomainService(logicalTypeName)
> -----------------------------------------------------------------------------
>
>                 Key: ISIS-2754
>                 URL: https://issues.apache.org/jira/browse/ISIS-2754
>             Project: Isis
>          Issue Type: New Feature
>          Components: Isis Core
>    Affects Versions: 2.0.0-M5
>            Reporter: Daniel Keir Haywood
>            Assignee: Daniel Keir Haywood
>            Priority: Minor
>             Fix For: 2.0.0-M6
>
>
> attempted this, using:
> {code:java}
> public @interface DomainService {
>     // ...
>     @AliasFor(annotation = Named.class, attribute = "value")
>     String logicalTypeName() default "";
> } {code}
> however it results in:
> {code:java}
> Caused by: org.springframework.core.annotation.AnnotationConfigurationException: @AliasFor declaration on attribute 'logicalTypeName' in annotation [org.apache.isis.applib.annotation.DomainService] declares an alias for attribute 'value' in annotation [javax.inject.Named] which is not meta-present. 
> at org.springframework.core.annotation.AnnotationTypeMapping.validateAllAliasesClaimed(AnnotationTypeMapping.java:372) 
> at org.springframework.core.annotation.AnnotationTypeMapping.afterAllMappingsSet(AnnotationTypeMapping.java:359) 
> at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 
> at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:69) 
> at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) 
> at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:245) 
> at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) {code}
> that means we need to add @Named to @DomainService
>  



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