当前位置: 首页>>代码示例>>Java>>正文


Java QueryDefault类代码示例

本文整理汇总了Java中org.apache.isis.applib.query.QueryDefault的典型用法代码示例。如果您正苦于以下问题:Java QueryDefault类的具体用法?Java QueryDefault怎么用?Java QueryDefault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QueryDefault类属于org.apache.isis.applib.query包,在下文中一共展示了QueryDefault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: query

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
private <T> Matcher<Query<T>> query(final Class<T> cls, final String queryName, final String param0, final Object arg0) {
    return new TypeSafeMatcher<Query<T>>() {
        @Override
        protected boolean matchesSafely(final Query<T> item) {
            if (!(item instanceof QueryDefault)) {
                return false;
            }
            final QueryDefault queryDefault = (QueryDefault) item;
            return queryDefault.getResultType() == cls &&
                    queryDefault.getQueryName().equals(queryName) &&
                    queryDefault.getArgumentsByParameterName().equals(ImmutableMap.of(param0, arg0));
        }

        @Override
        public void describeTo(final Description description) {
            description.appendText("query of " + cls.getName() + " using " + queryName);
        }
    };
}
 
开发者ID:danhaywood,项目名称:isis-app-petclinic,代码行数:20,代码来源:OwnersTest.java

示例2: firstMatch

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Action(
        domainEvent = ActionDomainEvent.class,
        semantics = SemanticsOf.SAFE
)
@ActionLayout(
        contributed = Contributed.AS_ACTION,
        cssClassFa = "fa-step-forward",
        cssClassFaPosition = ActionLayout.CssClassFaPosition.RIGHT
)
public UserSetting $$() {
    return firstMatch(
            new QueryDefault<>(UserSettingJdo.class,
                    "findNext",
                    "user", current.getUser(),
                    "key", current.getKey()));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-settings,代码行数:17,代码来源:UserSetting_next.java

示例3: allMatches

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Action(
        domainEvent = ActionDomainEvent.class,
        semantics = SemanticsOf.SAFE
)
@ActionLayout(
        contributed = Contributed.AS_ACTION,
        cssClassFa = "fa-step-backward",
        cssClassFaPosition = ActionLayout.CssClassFaPosition.LEFT
)
public UserSetting $$() {
    // bit of a workaround; for some reason ORDER BY ... DESC seems to return in ascending order
    final List<UserSettingJdo> settings = allMatches(
            new QueryDefault<>(UserSettingJdo.class,
                    "findPrevious",
                    "user", current.getUser(),
                    "key", current.getKey()));
    final int size = settings.size();
    return size != 0? settings.get(size-1): null;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-settings,代码行数:20,代码来源:UserSetting_previous.java

示例4: findByDocumentAndAttachedToAndRoleName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public Paperclip findByDocumentAndAttachedToAndRoleName(
        final DocumentAbstract<?> document,
        final Object attachedTo,
        final String roleName) {
    if(document == null) {
        return null;
    }
    if(attachedTo == null) {
        return null;
    }
    if(roleName == null) {
        return null;
    }
    final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
    if(bookmark == null) {
        return null;
    }
    final String attachedToStr = bookmark.toString();
    return repositoryService.firstMatch(
            new QueryDefault<>(Paperclip.class,
                    "findByDocumentAndAttachedToAndRoleName",
                    "document", document,
                    "attachedToStr", attachedToStr,
                    "roleName", roleName));
}
 
开发者ID:estatio,项目名称:estatio,代码行数:27,代码来源:PaperclipRepository.java

示例5: findByDocumentAndAttachedTo

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public List<Paperclip> findByDocumentAndAttachedTo(
        final DocumentAbstract<?> document,
        final Object attachedTo) {
    if(document == null) {
        return null;
    }
    if(attachedTo == null) {
        return null;
    }
    final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
    if(bookmark == null) {
        return null;
    }
    final String attachedToStr = bookmark.toString();
    return repositoryService.allMatches(
            new QueryDefault<>(Paperclip.class,
                    "findByDocumentAndAttachedTo",
                    "document", document,
                    "attachedToStr", attachedToStr));
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:PaperclipRepository.java

示例6: findByOwnerAndCommunicationChannelType

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public List<CommunicationChannelOwnerLink> findByOwnerAndCommunicationChannelType(
        final CommunicationChannelOwner owner,
        final CommunicationChannelType communicationChannelType) {
    if(owner == null) {
        return null;
    }
    if(communicationChannelType == null) {
        return null;
    }
    final Bookmark bookmark = bookmarkService.bookmarkFor(owner);
    if(bookmark == null) {
        return null;
    }
    return container.allMatches(
            new QueryDefault<>(CommunicationChannelOwnerLink.class,
                    "findByOwnerAndCommunicationChannelType",
                    "ownerObjectType", bookmark.getObjectType(),
                    "ownerIdentifier", bookmark.getIdentifier(),
                    "communicationChannelType", communicationChannelType));
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:CommunicationChannelOwnerLinkRepository.java

示例7: findByCommunicationChannelAndPendingOrCreatedAtBetween

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public List<Communication> findByCommunicationChannelAndPendingOrCreatedAtBetween(
        final CommunicationChannel communicationChannel,
        final DateTime fromDateTime,
        final DateTime toDateTime) {
    final List<Communication> communications =
            Lists.newArrayList(
                repositoryService.allMatches(
                    new QueryDefault<>(Communication.class,
                            "findByCommunicationChannelAndPendingOrCreatedAtBetween",
                            "communicationChannel", communicationChannel,
                            "from", fromDateTime,
                            "to", toDateTime))
            );

    communications.sort(Communication.Orderings.createdAtDescending);

    return communications;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:CommunicationRepository.java

示例8: findByObjectTypeAndNameAndApplicableToAtPath

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
/**
 * Returns the most applicable {@link DocFragment} by atPath
 *
 * <p>
 * for example, will match "/ITA/CAR" precedence over "/ITA" precedence over "/".
 * </p>
 *
 * @param objectType - the (as per {@link DomainObject#objectType() objectType} of the object to be used to interpolate
 * @param name
 * @param atPath
 */
@Programmatic
public DocFragment findByObjectTypeAndNameAndApplicableToAtPath(
        final String objectType,
        final String name,
        final String atPath) {

    // workaround, the ORDER BY atPath DESC doesn't seem to be honoured, don't know why...
    // we therefore do a client-side sort
    final List<DocFragment> ts = repositoryService.allMatches(
            new QueryDefault<>(
                    DocFragment.class,
                    "findByObjectTypeAndNameAndApplicableToAtPath",
                    "objectType", objectType,
                    "name", name,
                    "atPath", atPath));
    Collections.sort(ts, (o1, o2) -> o2.getAtPath().length() - o1.getAtPath().length());

    return ts.isEmpty() ? null : ts.get(0);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:31,代码来源:DocFragmentRepository.java

示例9: findBetween

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public List<Document> findBetween(final LocalDate startDate, final LocalDate endDateIfAny) {

    final DateTime startDateTime = startDate.toDateTimeAtStartOfDay();

    final QueryDefault<Document> query;
    if (endDateIfAny != null) {
        final DateTime endDateTime = endDateIfAny.plusDays(1).toDateTimeAtStartOfDay();
        query = new QueryDefault<>(Document.class,
                "findByCreatedAtBetween",
                "startDateTime", startDateTime,
                "endDateTime", endDateTime);
    }
    else {
        query = new QueryDefault<>(Document.class,
                "findByCreatedAtAfter",
                "startDateTime", startDateTime);
    }

    return repositoryService.allMatches(query);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:DocumentRepository.java

示例10: findByAttachedToAndRoleName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
@Programmatic
public List<Paperclip> findByAttachedToAndRoleName(
        final Object attachedTo,
        final String roleName) {
    if(attachedTo == null) {
        return null;
    }
    if(roleName == null) {
        return null;
    }
    final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
    if(bookmark == null) {
        return null;
    }
    final String attachedToStr = bookmark.toString();
    return repositoryService.allMatches(
            new QueryDefault<>(Paperclip.class,
                    "findByAttachedToAndRoleName",
                    "attachedToStr", attachedToStr,
                    "roleName", roleName));
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:PaperclipRepository.java

示例11: findByName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
public List<Employee> findByName(final String name) {
    return repositoryService.allMatches(
            new QueryDefault<>(
                    Employee.class,
                    "findByName",
                    "name", name));
}
 
开发者ID:bibryam,项目名称:rotabuilder,代码行数:8,代码来源:EmployeeRepository.java

示例12: findSkillsByName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
public List<Skill> findSkillsByName(final String code) {
    return repositoryService.allMatches(
            new QueryDefault<>(
                    Skill.class,
                    "findByName",
                    "code", code));
}
 
开发者ID:bibryam,项目名称:rotabuilder,代码行数:8,代码来源:EmployeeRepository.java

示例13: findByName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
public List<Project> findByName(final String name) {
    return repositoryService.allMatches(
            new QueryDefault<>(
                    Project.class,
                    "findByName",
                    "name", name));
}
 
开发者ID:bibryam,项目名称:semat,代码行数:8,代码来源:ProjectRepository.java

示例14: findStates

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
public List<State> findStates(AlphaType alphaType) {
    return repositoryService.allMatches(
            new QueryDefault<>(
                    State.class,
                    "findByAlphaType",
                    "alphaType", alphaType));

}
 
开发者ID:bibryam,项目名称:semat,代码行数:9,代码来源:StateRepository.java

示例15: findByName

import org.apache.isis.applib.query.QueryDefault; //导入依赖的package包/类
public List<SimpleObject> findByName(final String name) {
    return repositoryService.allMatches(
            new QueryDefault<>(
                    SimpleObject.class,
                    "findByName",
                    "name", name));
}
 
开发者ID:Stephen-Cameron-Data-Services,项目名称:isis-agri,代码行数:8,代码来源:SimpleObjectRepository.java


注:本文中的org.apache.isis.applib.query.QueryDefault类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。