Class DtoInspector

java.lang.Object
org.litebridge.orm.persistence.DtoInspector

public final class DtoInspector extends Object
Provides metadata about the state of an entity/mapped DTO.
  • Constructor Details

    • DtoInspector

      public DtoInspector(TableRegistry tableRegistry)
      Creates a new DtoInspector instance.
      Parameters:
      tableRegistry - The Litebridge ORM table registry to use.
  • Method Details

    • isPrimaryKeySet

      public boolean isPrimaryKeySet(Object dto)
      Checks whether the primary key of the given entity/mapped DTO is set.
      Parameters:
      dto - The entity/mapped DTO to check.
      Returns:
      true if the primary key is set, false otherwise.
    • getPrimaryKeyType

      public Class<?> getPrimaryKeyType(Object dto)
    • getPrimaryKeyType

      public Class<?> getPrimaryKeyType(Class<?> dtoClass)
    • getPrimaryKey

      public <PkType> @Nullable PkType getPrimaryKey(Object dto)
    • getPrimaryKey

      public <PkType> @Nullable PkType getPrimaryKey(Object dto, Class<PkType> pkType)