Class ToBXQuery

java.lang.Object
ortus.boxlang.runtime.bifs.BIF
ortus.boxlang.runtime.bifs.global.stream.ToBXQuery

@BoxMember(type=STREAM) public class ToBXQuery extends BIF
  • Constructor Details

    • ToBXQuery

      public ToBXQuery()
      Constructor
  • Method Details

    • _invoke

      public Object _invoke(IBoxContext context, ArgumentsScope arguments)
      Collect a Java stream into a BoxLang Query. Provide a template query to match the columns and types of the stream. Once the stream collects, it will return a Query object that can be used in BoxLang.

      Usage

       // Create a query template
       templateQuery = queryNew( "id,name,age" );
       // Create a stream from an array of structs
       stream = [ {id:1, name:"John", age:30}, {id:2, name:"Jane", age:25} ].toStream();
       // Convert the stream to a query
       result = stream.toBXQuery( templateQuery );
       
      Specified by:
      _invoke in class BIF
      Parameters:
      context - The context in which the BIF is being invoked.
      arguments - Argument scope for the BIF.
      Returns:
      The result of the invocation