Record Class QueryAlteringExpressionSpec<T>

java.lang.Object
java.lang.Record
org.litebridge.orm.expression.select.QueryAlteringExpressionSpec<T>
Type Parameters:
T -
Record Components:
delegate -
noMatchFallback -
limit -
All Implemented Interfaces:
ExpressionSpec, TypeOverride<T>, TypeOverrideExpressionSpec<T>

public record QueryAlteringExpressionSpec<T>(TypeOverrideExpressionSpec<T> delegate, @Nullable T noMatchFallback, Limit limit) extends Record implements TypeOverrideExpressionSpec<T>
An expression that alters the query in some way.

It allows setting a SQL limit and can return a fallback value if no database records were matched.

  • Constructor Details

    • QueryAlteringExpressionSpec

      public QueryAlteringExpressionSpec(TypeOverrideExpressionSpec<T> delegate, @Nullable T noMatchFallback, Limit limit)
      Creates an instance of a QueryAlteringExpressionSpec record class.
      Parameters:
      delegate - the value for the delegate record component
      noMatchFallback - the value for the noMatchFallback record component
      limit - the value for the limit record component
  • Method Details

    • returnType

      public Class<T> returnType()
      Description copied from interface: TypeOverride
      Gets the return type override of the query result.
      Specified by:
      returnType in interface TypeOverride<T>
      Returns:
      the type of the result.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • delegate

      public TypeOverrideExpressionSpec<T> delegate()
      Returns the value of the delegate record component.
      Returns:
      the value of the delegate record component
    • noMatchFallback

      public @Nullable T noMatchFallback()
      Returns the value of the noMatchFallback record component.
      Returns:
      the value of the noMatchFallback record component
    • limit

      public Limit limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component