Class EntityBeanDefinition<T>

java.lang.Object
com.datastax.astra.internal.reflection.EntityBeanDefinition<T>
Type Parameters:
T - the type of the JavaBean entity being introspected

public class EntityBeanDefinition<T> extends Object
Provides introspection and metadata for a JavaBean entity.

This class inspects a JavaBean of type T to extract and manage metadata about its properties. It is used to populate fields directly based on the output or other sources.

The EntityBeanDefinition is useful in scenarios where JavaBean introspection is needed for tasks such as data mapping, serialization, or populating object fields dynamically.

  • Constructor Details

    • EntityBeanDefinition

      public EntityBeanDefinition(Class<T> clazz)
      Constructor for the beam.
      Parameters:
      clazz - class type
  • Method Details

    • getPartitionBy

      public List<String> getPartitionBy()
      Build the partition Key based on annotated fields with @PartitionBy with position.
      Returns:
      An ordered list of partition keys (partition key)
    • getPartitionSort

      public Map<String,Integer> getPartitionSort()
      Build the partition sort based on annotated fields @PartitionSort with position and order.
      Returns:
      an ordered map representing the partition sort (clustering columns)
    • createTableCommand

      public static Document createTableCommand(String tableName, Class<?> clazz)
      Create a table command based on the annotated fields.
      Parameters:
      tableName - the table name
      clazz - the class
      Returns:
      a document representing the table command