Module storm

Interface RefFactory

All Known Implementing Classes:
RefFactoryImpl

public interface RefFactory
Interface for creating ref instances for records.
Since:
1.3
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Record, ID>
    Ref<T>
    create(Class<T> type, ID pk)
    Creates a ref instance for the specified record type and pk.
    <T extends Record, ID>
    Ref<T>
    create(T record, ID pk)
    Creates a ref instance for the specified record and pk.
  • Method Details

    • create

      <T extends Record, ID> Ref<T> create(@Nonnull Class<T> type, @Nonnull ID pk)
      Creates a ref instance for the specified record type and pk. This method can be used to generate ref instances for entities, projections and regular records.
      Type Parameters:
      T - record type.
      ID - primary key type.
      Parameters:
      type - record type.
      pk - primary key.
      Returns:
      ref instance.
    • create

      <T extends Record, ID> Ref<T> create(@Nonnull T record, @Nonnull ID pk)
      Creates a ref instance for the specified record and pk. This method can be used to generate ref instances for entities, projections and regular records. The object returned by this method already contains the fetched record.
      Type Parameters:
      T - record type.
      ID - primary key type.
      Parameters:
      pk - primary key.
      Returns:
      ref instance.