Codota Logo
QueryHandler
Code IndexAdd Codota to your IDE (free)

How to use
QueryHandler
in
org.axonframework.queryhandling

Best Java code snippets using org.axonframework.queryhandling.QueryHandler (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: AxonFramework/AxonFramework

  @QueryHandler
  public UserSummaryProjection handle(FindUserQuery query) {
    System.out.println("User created query handled");
    return null;
  }
}
origin: AxonIQ/axon-quick-start

@QueryHandler
public List<RoomSummary> on(AllRoomsQuery query){
  return roomSummaryRepository.findAll();
}
origin: AxonIQ/axon-quick-start

@QueryHandler
public List<String> on(RoomParticipantsQuery query) {
  return repository.findRoomParticipantsByRoomId(query.getRoomId())
           .stream()
           .map(RoomParticipant::getParticipant).sorted().collect(toList());
}
origin: pivotalsoftware/ESarch

@QueryHandler
public List<OrderBookView> find(OrderBooksByCompanyIdQuery query) {
  String companyId = query.getCompanyId().getIdentifier();
  return Optional.ofNullable(orderBookRepository.findByCompanyIdentifier(companyId))
          .map(this::eagerInit)
          .orElseGet(() -> {
            logger.warn("Tried to retrieve a OrderBook query model with a non existent company id [{}]",
                  companyId);
            return Collections.emptyList();
          });
}
origin: pivotalsoftware/ESarch

@QueryHandler
public UserView find(UserByIdQuery query) {
  String userId = query.getUserId().getIdentifier();
  return Optional.ofNullable(userRepository.findByIdentifier(userId))
          .orElseGet(() -> {
            logger.warn("Tried to retrieve a User query model with a non existent user id [{}]",
                  userId);
            return null;
          });
}
origin: pivotalsoftware/ESarch

  @QueryHandler
  public List<TransactionView> find(TransactionsByPortfolioIdQuery query) {
    String portfolioId = query.getPortfolioId().getIdentifier();
    return Optional.ofNullable(transactionViewRepository.findByPortfolioId(portfolioId))
            .orElseGet(() -> {
              logger.warn(
                  "Tried to retrieve a Transaction query model with a non existent portfolio id [{}]",
                  portfolioId
              );
              return Collections.emptyList();
            });
  }
}
origin: pivotalsoftware/ESarch

@QueryHandler
public CompanyView find(CompanyByIdQuery query) {
  String companyId = query.getCompanyId().getIdentifier();
  //noinspection ConstantConditions
  return Optional.ofNullable(companyRepository.getOne(companyId))
          .orElseGet(() -> {
            logger.warn("Tried to retrieve a Company query model with a non existent company id [{}]",
                  companyId);
            return null;
          });
}
origin: pivotalsoftware/ESarch

  @QueryHandler
  public List<TradeExecutedView> find(ExecutedTradesByOrderBookIdQuery query) {
    String orderBookId = query.getOrderBookId().getIdentifier();
    return Optional.ofNullable(tradeExecutedRepository.findByOrderBookId(orderBookId))
            .orElseGet(() -> {
              logger.warn(
                  "Tried to retrieve a Executed Trades query model with a non existent order book id [{}]",
                  orderBookId
              );
              return Collections.emptyList();
            });
  }
}
origin: pivotalsoftware/ESarch

@QueryHandler
public PortfolioView find(PortfolioByIdQuery query) {
  String portfolioId = query.getPortfolioId().getIdentifier();
  //noinspection ConstantConditions
  return Optional.ofNullable(portfolioViewRepository.getOne(portfolioId))
          .orElseGet(() -> {
            logger.warn("Tried to retrieve a Portfolio query model with a non existent portfolio id [{}]",
                  portfolioId);
            return null;
          });
}
origin: pivotalsoftware/ESarch

  @QueryHandler
  public PortfolioView find(PortfolioByUserIdQuery query) {
    String userId = query.getUserId().getIdentifier();
    return Optional.ofNullable(portfolioViewRepository.findByUserId(userId))
            .orElseGet(() -> {
              logger.warn("Tried to retrieve a Portfolio query model with a non existent user id [{}]",
                    userId);
              return null;
            });
  }
}
origin: pivotalsoftware/ESarch

@QueryHandler
public TransactionView find(TransactionByIdQuery query) {
  String transactionId = query.getTransactionId().getIdentifier();
  //noinspection ConstantConditions
  return Optional.ofNullable(transactionViewRepository.getOne(transactionId))
          .orElseGet(() -> {
            logger.warn(
                "Tried to retrieve a Transaction query model with a non existent transaction id [{}]",
                transactionId
            );
            return null;
          });
}
origin: pivotalsoftware/ESarch

@QueryHandler
public OrderBookView find(OrderBookByIdQuery query) {
  String orderBookId = query.getOrderBookId().getIdentifier();
  //noinspection ConstantConditions
  return Optional.ofNullable(orderBookRepository.getOne(orderBookId))
          .map(this::eagerInit)
          .orElseGet(() -> {
            logger.warn(
                "Tried to retrieve a OrderBook query model with a non existent order book id [{}]",
                orderBookId
            );
            return null;
          });
}
origin: AxonIQ/giftcard-demo

@QueryHandler
public CountCardSummariesResponse handle(CountCardSummariesQuery query) {
  log.trace("handling {}", query);
  TypedQuery<Long> jpaQuery = entityManager.createNamedQuery("CardSummary.count", Long.class);
  jpaQuery.setParameter("idStartsWith", query.getFilter().getIdStartsWith());
  return log.exit(new CountCardSummariesResponse(jpaQuery.getSingleResult().intValue(), Instant.now().toEpochMilli()));
}
origin: AxonIQ/axon-quick-start

@QueryHandler
public List<ChatMessage> on(RoomMessagesQuery query) {
  return repository.findAllByRoomIdOrderByTimestamp(query.getRoomId());
}
origin: AxonIQ/giftcard-demo

@QueryHandler
public List<CardSummary> handle(FetchCardSummariesQuery query) {
  log.trace("handling {}", query);
  TypedQuery<CardSummary> jpaQuery = entityManager.createNamedQuery("CardSummary.fetch", CardSummary.class);
  jpaQuery.setParameter("idStartsWith", query.getFilter().getIdStartsWith());
  jpaQuery.setFirstResult(query.getOffset());
  jpaQuery.setMaxResults(query.getLimit());
  return log.exit(jpaQuery.getResultList());
}
origin: pivotalsoftware/ESarch

  @QueryHandler
  public List<UserView> findAll(FindAllUsersQuery query) {
    return userRepository.findAll(PageRequest.of(query.getPageOffset(), query.getPageSize(), Sort.by(asc("name"))))
               .getContent();
  }
}
origin: pivotalsoftware/ESarch

  @QueryHandler
  public List<CompanyView> find(FindAllCompaniesQuery query) {
    return companyRepository.findAll(
        PageRequest.of(query.getPageOffset(), query.getPageSize(), Sort.by(asc("name")))
    ).getContent();
  }
}
org.axonframework.queryhandlingQueryHandler

Most used methods

  • <init>

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now