Class EntityDataLoadQueryParameter

java.lang.Object
io.jmix.aitools.dataload.generation.EntityDataLoadQueryParameter

public class EntityDataLoadQueryParameter extends Object
A parameter that generated query text may reference: its name, the Java type of the value it will be bound to, and how it is bound. Carries no value — a generated query references it by name and is given values only when it runs.
  • Field Details

    • name

      protected String name
    • javaType

      protected String javaType
    • multiValued

      protected boolean multiValued
    • optional

      protected boolean optional
  • Constructor Details

    • EntityDataLoadQueryParameter

      public EntityDataLoadQueryParameter(String name, String javaType)
  • Method Details

    • setMultiValued

      public EntityDataLoadQueryParameter setMultiValued(boolean multiValued)
      Marks the parameter as bound to a collection, so a query matches it with IN.
      Parameters:
      multiValued - whether the value is a collection of getJavaType()
      Returns:
      this parameter
    • setOptional

      public EntityDataLoadQueryParameter setOptional(boolean optional)
      Marks the parameter as one a caller may leave null, so a query referencing it must guard the condition.
      Parameters:
      optional - whether the value may be null
      Returns:
      this parameter
    • getName

      public String getName()
      Returns the name a generated query references this parameter by.
      Returns:
      the JPQL parameter name, without the leading colon
    • getJavaType

      public String getJavaType()
      Returns the Java type the value is bound as at execution.
      Returns:
      the fully qualified Java type, or "" when unknown
    • isMultiValued

      public boolean isMultiValued()
      Tells a parameter bound as a collection from a single-valued one, so a query matches it with IN.
      Returns:
      true if the value is a collection of getJavaType()
    • isOptional

      public boolean isOptional()
      Tells a parameter a caller may leave empty from one it always supplies. A query referencing an optional parameter must survive a null value, which in JPQL means guarding the condition.
      Returns:
      true if the value may be null