Interface DAOAnnotatedValueExtractor


public interface DAOAnnotatedValueExtractor
Service useful for extracting values from a DAO instance based on its annotations.
  • Method Details

    • getPool

      String getPool(@NotNull @NotNull DAO dao)
      Returns a String about the pool value extracted from the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the pool value.
      Returns:
      a String about the pool value extracted from the provided DAO instance.
    • getTable

      String getTable(@NotNull @NotNull DAO dao, CommandContext commandContext)
      Returns a String about the table value extracted from the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the table value.
      commandContext - the CommandContext instance associated to the provided DAO instance.
      Returns:
      a String about the table value extracted from the provided DAO instance.
    • getCode

      String getCode(@NotNull @NotNull DAO dao, CommandContext commandContext)
      Returns a String about the code value extracted from the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the code value.
      commandContext - the CommandContext instance associated to the provided DAO instance.
      Returns:
      a String about the code value extracted from the provided DAO instance.
    • getSequence

      String getSequence(@NotNull @NotNull DAO dao)
      Returns a String about the sequence value (primary key field) extracted from the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the sequence value.
      Returns:
      a String about the sequence value (primary key field) extracted from the provided DAO instance.
    • getPk

      String[] getPk(@NotNull @NotNull DAO dao)
      Returns an array of Strings about the pk values (primary key fields) extracted from the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the pk values.
      Returns:
      an array of Strings about the pk values (primary key fields) extracted from the provided DAO instance.
    • isService

      boolean isService(@NotNull @NotNull DAO dao)
      Returns the boolean value, extracted from the provided DAO instance, that determines whether connection extraction takes place from the standard pool or the service pool.
      Parameters:
      dao - the DAO instance from which extract the boolean value.
      Returns:
      false for ordinary connection extraction, true for ServicePool extraction.
    • isDistinct

      boolean isDistinct(@NotNull @NotNull DAO dao, CommandContext commandContext)
      Returns the boolean value, extracted from the provided DAO instance, that determines whether the queries use the DISTINCT clause or not.
      Parameters:
      dao - the DAO instance from which extract the boolean value.
      commandContext - the CommandContext instance associated to the provided DAO instance.
      Returns:
      true if the queries use the DISTINCT, false otherwise.
    • getStar

      String[] getStar(@NotNull @NotNull DAO dao, CommandContext commandContext)
      Returns the array that contains the field list for all the select queries generated by the provided DAO instance.
      Parameters:
      dao - the DAO instance from which extract the field list.
      commandContext - the CommandContext instance associated to the provided DAO instance.
      Returns:
      the array of strings that represents the names of the columns to be extracted for all the select queries generated by the provided DAO instance; the default value is the array consisting of a single element, the character *.
    • getLevel

      String getLevel(@NotNull @NotNull DAO dao)
      Returns the name of the field of the table in which is stored the level value for the provided DAO instance, so that the optimistic lock can be managed.
      Parameters:
      dao - the DAO instance from which extract the level value.
      Returns:
      the String about the name of the field of the table in which is stored the level value for the provided DAO instance, so that the optimistic lock can be managed.
    • getEncrypt

      String[] getEncrypt(@NotNull @NotNull DAO dao)
      Returns a String[] about the fields that need to be encrypted for the provided DAO instance, so that encryption can be handled on those fields.
      Parameters:
      dao - the DAO instance from which extract the fields that need to be encrypted.
      Returns:
      a String[] about the fields that need to be encrypted for the provided DAO instance, so that encryption can be handled on those fields.
    • getFactory

      String getFactory(@NotNull @NotNull DAO dao)
      Returns a String about the name of the field of the table in which is stored the factory ID value for the provided DAO instance, set with the DAO.Factory annotation.
      Parameters:
      dao - the DAO instance from which extract the factory ID value.
      Returns:
      the String that represents the name of the field of the table in which is stored the factory ID value for the provided DAO instance, that is, the foreign key to the factories table.
    • getBranch

      String getBranch(@NotNull @NotNull DAO dao)
      Returns a String about the name of the field of the table in which is stored the branch ID value for the provided DAO instance, set with the DAO.Branch annotation.
      Parameters:
      dao - the DAO instance from which extract the branch ID value.
      Returns:
      the String that represents the name of the field of the table in which is stored the branch ID value for the provided DAO instance, that is, the foreign key to the branches table.
    • getTransaction

      String getTransaction(@NotNull @NotNull DAO dao)
      Returns a String about the name of the transaction for the provided DAO instance, set with the DAO.Transaction annotation.
      Parameters:
      dao - the DAO instance from which extract the transaction name.
      Returns:
      the String that represents the name of the transaction for the provided DAO instance.
    • getGroup

      String[] getGroup(@NotNull @NotNull DAO dao, CommandContext commandContext)
      Returns a String[] about the names of the columns on which we want to group the results of the queries, extracted from the provided DAO instance.
      Parameters:
      commandContext - the CommandContext instance associated to the provided DAO instance.
      Returns:
      a String[] about the names of the columns on which we want to group the results of the queries, extracted from the provided DAO instance.