Class QueryField

java.lang.Object
org.litebridgedb.orm.meta.QueryField
All Implemented Interfaces:
ExpressionSpec
Direct Known Subclasses:
NumericQueryField, StringQueryField

public sealed class QueryField extends Object implements ExpressionSpec permits NumericQueryField, StringQueryField
Basic metamodel field definition.

Entity/DTO metamodels are used for type-safe queries. This implementation provides no additional functionality beyond the ability to be used in queries.

  • Field Details

    • dtoClass

      protected final Class<?> dtoClass
      Class of the DTO the field belongs to
    • field

      protected final String field
      Target field name.
  • Constructor Details

    • QueryField

      public QueryField(Class<?> dtoClass, String field)
      Creates a new QueryField instance.
      Parameters:
      dtoClass - DTO class the field belongs to.
      field - Target field name.
  • Method Details

    • convert

      public <T> ConvertSpec<T> convert(Class<T> returnType)
      Converts the value of the database column targeted by this field into the specified Java type.

      This uses Litebridge's registered type converter to perform the conversion; it is not a database operation.

      Parameters:
      returnType - The type to convert the expression result to
      Returns:
      a ProtoColumnExpressionSpec expression instance to convert the return value of the nested expression
    • toString

      public String toString()
      Overrides:
      toString in class Object