Class PromptQueryFileEntity

java.lang.Object
de.xima.fc.prompt.ms.impl.dao.entities.PromptQueryFileEntity

@Entity public class PromptQueryFileEntity extends Object
JPA entity for the metadata of a file from a PromptQueryFileEntity. Each prompt query contains Map<String, List<File>>, i.e. multiple files for each string key. The meaning of the keys and the files depends on the type of prompt service.
Since:
8.5.0
  • Constructor Details

    • PromptQueryFileEntity

      public PromptQueryFileEntity()
  • Method Details

    • getBaseEntity

      public PromptQueryEntity getBaseEntity()
      Gets the prompt query entity that contains this file.
      Returns:
      The prompt query entity that contains this file.
    • setBaseEntity

      public void setBaseEntity(PromptQueryEntity baseEntity)
      Sets the prompt query entity that contains this file.
      Parameters:
      baseEntity - The prompt query entity that contains this file.
    • getCreatedInstant

      public Instant getCreatedInstant()
      Gets the point in time when this file was originally created.
      Returns:
      The time when this file was originally created.
    • setCreatedInstant

      public void setCreatedInstant(Instant createdInstant)
      Sets the point in time when this file was originally created.
      Parameters:
      createdInstant - The time when this file was originally created.
    • getCreatorName

      public String getCreatorName()
      Gets the name of the user who originally created this file.
      Returns:
      The name of the user who originally created this file.
    • setCreatorName

      public void setCreatorName(String creatorName)
      Sets the name of the user who originally created this file.
      Parameters:
      creatorName - The name of the user who originally created this file.
    • getDataEntity

      public PromptQueryFileDataEntity getDataEntity()
      Gets the single associated data entity holding the actual binary data of the file. You should prefer this method over getDataEntities(), as that list can only ever contain a single element.
      Returns:
      The data entity with the binary data.
    • getFileIndex

      public int getFileIndex()
      The file index of this prompt query file. This is used to differentiate between multiple files with the same key. The list of all files forms a Map<String, List<File>> where the key is the file key and the file index is the index in the list.
      Returns:
      The file index of the file, indicating its order among files with the same key.
    • setFileIndex

      public void setFileIndex(int fileIndex)
      The file index of this prompt query file. This is used to differentiate between multiple files with the same key. The list of all files forms a Map<String, List<File>> where the key is the file key and the file index is the index in the list.
      Parameters:
      fileIndex - The file index of this prompt query file.
    • getFileKey

      public String getFileKey()
      Gets the key that determines the purpose of this file
      Returns:
      file key
    • setFileKey

      public void setFileKey(String fileKey)
      Sets the key that determines the purpose of this file
      Parameters:
      fileKey - determining the purpose of this file
    • getFileName

      public String getFileName()
      Gets the name of the file.
      Returns:
      The name of the file.
    • setFileName

      public void setFileName(String fileName)
      Sets the name of the file.
      Parameters:
      fileName - The name of the file.
    • getFileSize

      public int getFileSize()
      Gets the size of the file in bytes, i.e. the number of bytes of the data stored in the associated data entity.
      Returns:
      The size of the file in bytes.
    • setFileSize

      public void setFileSize(int fileSize)
      Sets the size of the file in bytes, i.e. the number of bytes of the data stored in the associated data entity.
      Parameters:
      fileSize - The size of the file in bytes.
    • getId

      public Long getId()
      Gets the database ID of this prompt query file. The database ID is unique within the system, across all tenants.
      Returns:
      The database ID of this prompt query file.
    • setId

      public void setId(Long id)
      Sets the database ID of this prompt query file. The database ID is unique within the system, across all tenants.
      Parameters:
      id - The database ID of this prompt query file.
    • getMimeType

      public String getMimeType()
      Gets the mime type of this file, i.e. a string like "image/png" or "application/pdf".
      Returns:
      The mime type of this file.
    • setMimeType

      public void setMimeType(String mimeType)
      Sets the mime type of this file, i.e. a string like "image/png" or "application/pdf".
      Parameters:
      mimeType - The mime type of this file.
    • getModifiedInstant

      public Instant getModifiedInstant()
      Gets the point in time when this file was last modified.
      Returns:
      The time when this file was last modified.
    • setModifiedInstant

      public void setModifiedInstant(Instant modifiedInstant)
      Sets the point in time when this file was last modified.
      Parameters:
      modifiedInstant - The time when this file was last modified.
    • getModifierName

      public String getModifierName()
      Gets the name of the user who last modified this file.
      Returns:
      The name of the user who last modified this file.
    • setModifierName

      public void setModifierName(String modifierName)
      Sets the name of the user who last modified this file.
      Parameters:
      modifierName - The name of the user who last modified this file.
    • setData

      public void setData(byte[] data)
      Shortcut to set the binary data of the associated data entity.
      Parameters:
      data - The new binary data.
    • getDataEntities

      protected List<PromptQueryFileDataEntity> getDataEntities()
      Gets the list of data entities associated with this prompt query file. This list can only ever contain a single element, use getDataEntity() instead. This method is intended for JPA only. We want the file data to be loaded lazily, which only works reliably with a collection (1:n relationship).
      Returns:
      The list of data entities associated with this prompt query file.
    • setDataEntities

      protected void setDataEntities(List<PromptQueryFileDataEntity> dataEntities)
      Sets the list of data entities associated with this prompt query file. This method is intended for JPA only. We want the file data to be loaded lazily, which only works reliably with a collection (1:n relationship).
      Parameters:
      dataEntities - The list of data entities associated with this prompt query file.