Class AdtQuery

java.lang.Object
infrastructure.digitaltwins.query.AdtQuery

public class AdtQuery extends Object
Helper class to construct query for Azure Digital Twins service.
  • Constructor Details

    • AdtQuery

      public AdtQuery()
      Default constructor.
  • Method Details

    • select

      public AdtQuery select(String... elements)
      Select query considering returned elements.
      Parameters:
      elements - the elements to return from the query
      Returns:
      the updated query
    • selectTop

      public AdtQuery selectTop(int numberOfElementsToSelect, String... elements)
      Select query but return only numberOfElements top elements.
      Parameters:
      numberOfElementsToSelect - the number of top elements to return
      elements - the elements to return from the query
      Returns:
      the updated query
    • fromDigitalTwins

      public AdtQuery fromDigitalTwins(String alias)
      Specify the FROM digital twins clause with its alias. This alias can be used later to refer to it.
      Parameters:
      alias - the alias for the digital twin
      Returns:
      the updated query
    • joinRelationship

      public AdtQuery joinRelationship(String dstAlias, String srcAlias, String relationshipName)
      Join the query with a relationship, specified by its relationshipName of the srcAlias digital twin. Specify also the dstAlias used to describe the destination digital twin.
      Parameters:
      dstAlias - the alias of the target of the relationship
      srcAlias - the alias of the source of the relationship
      relationshipName - the name of the relationship to join
      Returns:
      the updated query
    • where

      public AdtQuery where(String whereClause)
      Where clause to include in the query.
      Parameters:
      whereClause - the where clause
      Returns:
      the updated query
    • and

      public AdtQuery and(String whereClause)
      Chain in and another where clause.
      Parameters:
      whereClause - the where clause to chain
      Returns:
      the updated query
    • toQuery

      public String toQuery()
      Method used to export the final query.
      Returns:
      the query