@ivo: just fyi: usually we support Deactivatable if something is enabled per default and there is no std. way to disable it easily. due to the primary use-case for repositories (which was/is [1]), you can be sure that we will continue to support a way to disable them dynamically.
@john: with owb @Vetoed should work as expected in this case. if it isn't the case for weld, we could add a manual check (via reflection) at the same point as the check for Deactivatable. regards, gerhard [1] https://issues.apache.org/jira/browse/DELTASPIKE-588 2018-01-05 16:24 GMT+01:00 John D. Ament <[email protected]>: > Thomas, > > @Vetoed won't work since we are generating a bean for the class at runtime > (the discovered AnnotatedType isn't a valid bean). > > Ivo, > > There is a solution you can use right now. Repositories support > deactivation, which is effectively Vetoed but before Vetoed exists. We > also provide an OOTB class deactivator you can use that is based purely on > configuration. > > To do this, follow the instructions at > http://deltaspike.apache.org/documentation/data.html# > DeactivatingRepositories > Then use the default class deactivator to deactivate just your utility > class > http://deltaspike.apache.org/documentation/core.html# > DeactivateDeactivatable-ClassesviaConfig > > Give that a shot, let us know how it goes. > > John > > On Fri, Jan 5, 2018 at 9:40 AM Thomas Andraschko < > [email protected]> wrote: > > > @ivo > > i wonder if it works when adding @Vetoed? > > > > 2018-01-05 14:09 GMT+01:00 Gerhard Petracek <[email protected]>: > > > > > @john: > > > i mentioned ExcludeExtension [1] and not @Exclude > > > > > > regards, > > > gerhard > > > > > > [1] > > > https://github.com/apache/deltaspike/blob/master/ > > > deltaspike/core/impl/src/main/java/org/apache/deltaspike/ > > > core/impl/exclude/extension/ExcludeExtension.java > > > > > > > > > > > > 2018-01-05 14:06 GMT+01:00 John D. Ament <[email protected]>: > > > > > > > Gerhard, > > > > > > > > I see Exclude is in the API [1], not the Impl. I don't see this > > > > duplicating, but sure I suspect we can add both trivially. > > > > > > > > John > > > > > > > > [1]: > > > > https://github.com/apache/deltaspike/blob/master/ > > > > deltaspike/core/api/src/main/java/org/apache/deltaspike/ > > > > core/api/exclude/Exclude.java > > > > > > > > > > > > On Fri, Jan 5, 2018 at 8:02 AM Gerhard Petracek < > [email protected]> > > > > wrote: > > > > > > > > > @john: > > > > > it's the opposite, because you can support @Vetoed via reflection, > > but > > > > for > > > > > @Exclude we need at least a vote. > > > > > (reason: you would need to (re-)use internals of ExcludeExtension > in > > > > > RepositoryExtension which introduces a compile dependendy to > > > > > deltaspike-core-impl) > > > > > > > > > > regards, > > > > > gerhard > > > > > > > > > > > > > > > > > > > > 2018-01-05 13:47 GMT+01:00 John D. Ament <[email protected]>: > > > > > > > > > > > Adding a check for Exclude would make sense and be easy. Adding > > > > Vetoed, > > > > > > since we're still CDI 1.0, would be hard. I just put in > > > > > > https://issues.apache.org/jira/browse/DELTASPIKE-1311 and can > plan > > > to > > > > > take > > > > > > care of that for you in 1.8.2. > > > > > > > > > > > > Thanks for the info, and thanks for the clarifications! > > > > > > > > > > > > John > > > > > > > > > > > > On Fri, Jan 5, 2018 at 7:39 AM Thomas Andraschko < > > > > > > [email protected]> wrote: > > > > > > > > > > > > > Yep, i see. AbstractEntityRepository has a @Repository of > course. > > > > > > > We could of course add a check for @Vetoed/Exclude but not sure > > if > > > it > > > > > has > > > > > > > any side effects. > > > > > > > > > > > > > > 2018-01-05 13:31 GMT+01:00 Ivo Limmen <[email protected]>: > > > > > > > > > > > > > > > I did. Since my AbstractMultitenancyRepository extends > > > > > > > > AbstractEntityRepository it is included as a "real" > repository; > > > > even > > > > > > > though > > > > > > > > it has no @Repository. > > > > > > > > > > > > > > > > Best regards, > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > On Fri, Jan 5, 2018 at 1:24 PM, Thomas Andraschko < > > > > > > > > [email protected]> wrote: > > > > > > > > > > > > > > > > > It actually shoudln't if there is no @Repository present. > > Could > > > > you > > > > > > > debug > > > > > > > > > RepositoryExtension#isRepository? > > > > > > > > > > > > > > > > > > > > > > > > > > > 2018-01-05 13:20 GMT+01:00 Ivo Limmen <[email protected]>: > > > > > > > > > > > > > > > > > > > Yes it is. > > > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > On Fri, Jan 5, 2018 at 1:19 PM, John D. Ament < > > > > > > > [email protected]> > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > Ivo, > > > > > > > > > > > > > > > > > > > > > > You should not add @Repository to this class. Is it > > still > > > > > > > discovered > > > > > > > > > > then? > > > > > > > > > > > > > > > > > > > > > > John > > > > > > > > > > > > > > > > > > > > > > On Fri, Jan 5, 2018 at 7:12 AM Ivo Limmen < > > [email protected]> > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > Hi John, > > > > > > > > > > > > > > > > > > > > > > > > I am trying to AVOID discovery of the repository as > it > > > is a > > > > > > > > abstract > > > > > > > > > > base > > > > > > > > > > > > repository with common utility methods. I tried by > > adding > > > > > > > > @Repository > > > > > > > > > > but > > > > > > > > > > > > it does not work. > > > > > > > > > > > > I tried adding @Exclude on the repository but the > > > > > > > > RepositoryExtension > > > > > > > > > > > does > > > > > > > > > > > > not filter on @Exclude annotated repositories. > > > > > > > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > On Fri, Jan 5, 2018 at 1:09 PM, John D. Ament < > > > > > > > > > [email protected]> > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > Hi Ivo, > > > > > > > > > > > > > > > > > > > > > > > > > > For any repository to be discovered, it should be > > > > annotated > > > > > > > > > > > @Repository. > > > > > > > > > > > > > If this is your own custom class, I would simply > > remove > > > > > that > > > > > > > > > > > annotation. > > > > > > > > > > > > > > > > > > > > > > > > > > John > > > > > > > > > > > > > > > > > > > > > > > > > > On Fri, Jan 5, 2018 at 6:42 AM Ivo Limmen < > > > > [email protected]> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi list, > > > > > > > > > > > > > > > > > > > > > > > > > > > > I am using DeltaSpike for my project and I like > it > > > very > > > > > > much. > > > > > > > > > But I > > > > > > > > > > > am > > > > > > > > > > > > > > trying to exclude an abstract repository (my own > > > > abstract > > > > > > > base > > > > > > > > > > > > > repository) > > > > > > > > > > > > > > from being picked up by the RepositoryExtention. > > > > > > > > > > > > > > I tried @Exclude but that does not work. Then I > > > > > discovered > > > > > > > that > > > > > > > > > > 1.8.1 > > > > > > > > > > > > was > > > > > > > > > > > > > > release (I used 1.8.0) but that did not help > > either. > > > > > > > > > > > > > > I saw that the method RepositoryExtension. > > > > isRepository() > > > > > > does > > > > > > > > > not > > > > > > > > > > > > > exclude > > > > > > > > > > > > > > any interfaces or abstract classes; it this > feature > > > > > > missing? > > > > > > > > > > > > > > Or am I using it wrong? > > > > > > > > > > > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > Met vriendelijke groet, > > > > > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > Met vriendelijke groet, > > > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Met vriendelijke groet, > > > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Met vriendelijke groet, > > > > > > > > Ivo Limmen > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
