Class Schema.JavaField

java.lang.Object
tech.ydb.yoj.databind.schema.Schema.JavaField
Enclosing class:
Schema<T>

public static final class Schema.JavaField extends Object
  • Method Details

    • getDbType

      public DbType getDbType()
      Returns the DB column type name (which is strongly DB-specific).

      If the Column annotation is present, the field dbType may be used to specify the DB column type.

      Returns:
      the DB column type for data binding if specified, null otherwise
      See Also:
    • getDbTypeQualifier

      public String getDbTypeQualifier()
      Returns the DB column type presentation qualifier name.
      Returns:
      the DB column type presentation qualifier for data binding if specified, null otherwise
      See Also:
    • getType

      public Type getType()
    • getRawType

      public Class<?> getRawType()
    • setName

      @Deprecated public void setName(String newName)
      Deprecated.
    • getRawPath

      @Beta public String getRawPath()
    • getRawSubPath

      @Beta public String getRawSubPath(int start)
    • getChildren

      public List<Schema.JavaField> getChildren()
    • flatten

      public Stream<Schema.JavaField> flatten()
    • flattenWithValue

      public Stream<Schema.JavaFieldValue> flattenWithValue(Object o)
    • collectValueTo

      public void collectValueTo(Object v, Map<String,Object> res)
    • isSimple

      public boolean isSimple()
      Returns:
      true if this is a simple (not composite) value; false otherwise
    • isFlat

      public boolean isFlat()
      Returns:
      true if this field maps to a single database field, even if it is technically a composite value;
      false otherwise
      See Also:
    • getFlatFieldType

      public Type getFlatFieldType()
      Returns:
      Java type of the lowest-level simple field, if this field is flat
      Throws:
      IllegalStateException - field is not flat
      See Also:
    • toFlatField

      public Schema.JavaField toFlatField()
      Returns:
      single lowest-level simple field, if this field is flat
      Throws:
      IllegalStateException - field is not flat
      See Also:
    • getCustomValueType

      @Nullable public CustomValueType getCustomValueType()
      Returns:
      @CustomValueType annotation for the schema field or its type. This experimental annotation specifies custom value conversion logic between Java field values and database column values.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • forSchema

      @NonNull public <T> @NonNull Schema.JavaField forSchema(@NonNull @NonNull Schema<T> dstSchema, @NonNull @NonNull UnaryOperator<String> pathTransformer)