Class PromptQueryFileEntity
java.lang.Object
de.xima.fc.prompt.ms.impl.dao.entities.PromptQueryFileEntity
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the prompt query entity that contains this file.Gets the point in time when this file was originally created.Gets the name of the user who originally created this file.protected List<PromptQueryFileDataEntity> Gets the list of data entities associated with this prompt query file.Gets the single associated data entity holding the actual binary data of the file.intThe file index of this prompt query file.Gets the key that determines the purpose of this fileGets the name of the file.intGets the size of the file in bytes, i.e. the number of bytes of the data stored in the associateddata entity.getId()Gets the database ID of this prompt query file.Gets the mime type of this file, i.e. a string like "image/png" or "application/pdf".Gets the point in time when this file was last modified.Gets the name of the user who last modified this file.voidsetBaseEntity(PromptQueryEntity baseEntity) Sets the prompt query entity that contains this file.voidsetCreatedInstant(Instant createdInstant) Sets the point in time when this file was originally created.voidsetCreatorName(String creatorName) Sets the name of the user who originally created this file.voidsetData(byte[] data) Shortcut to set the binary data of the associateddata entity.protected voidsetDataEntities(List<PromptQueryFileDataEntity> dataEntities) Sets the list of data entities associated with this prompt query file.voidsetFileIndex(int fileIndex) The file index of this prompt query file.voidsetFileKey(String fileKey) Sets the key that determines the purpose of this filevoidsetFileName(String fileName) Sets the name of the file.voidsetFileSize(int fileSize) Sets the size of the file in bytes, i.e. the number of bytes of the data stored in the associateddata entity.voidSets the database ID of this prompt query file.voidsetMimeType(String mimeType) Sets the mime type of this file, i.e. a string like "image/png" or "application/pdf".voidsetModifiedInstant(Instant modifiedInstant) Sets the point in time when this file was last modified.voidsetModifierName(String modifierName) Sets the name of the user who last modified this file.
-
Constructor Details
-
PromptQueryFileEntity
public PromptQueryFileEntity()
-
-
Method Details
-
getBaseEntity
Gets the prompt query entity that contains this file.- Returns:
- The prompt query entity that contains this file.
-
setBaseEntity
Sets the prompt query entity that contains this file.- Parameters:
baseEntity- The prompt query entity that contains this file.
-
getCreatedInstant
Gets the point in time when this file was originally created.- Returns:
- The time when this file was originally created.
-
setCreatedInstant
Sets the point in time when this file was originally created.- Parameters:
createdInstant- The time when this file was originally created.
-
getCreatorName
Gets the name of the user who originally created this file.- Returns:
- The name of the user who originally created this file.
-
setCreatorName
Sets the name of the user who originally created this file.- Parameters:
creatorName- The name of the user who originally created this file.
-
getDataEntity
Gets the single associated data entity holding the actual binary data of the file. You should prefer this method overgetDataEntities(), 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 aMap<String, List<File>>where the key is thefile keyand thefile indexis 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 aMap<String, List<File>>where the key is thefile keyand thefile indexis the index in the list.- Parameters:
fileIndex- The file index of this prompt query file.
-
getFileKey
-
setFileKey
Sets the key that determines the purpose of this file- Parameters:
fileKey- determining the purpose of this file
-
getFileName
-
setFileName
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 associateddata 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 associateddata entity.- Parameters:
fileSize- The size of the file in bytes.
-
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
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
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
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
Gets the point in time when this file was last modified.- Returns:
- The time when this file was last modified.
-
setModifiedInstant
Sets the point in time when this file was last modified.- Parameters:
modifiedInstant- The time when this file was last modified.
-
getModifierName
Gets the name of the user who last modified this file.- Returns:
- The name of the user who last modified this file.
-
setModifierName
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 associateddata entity.- Parameters:
data- The new binary data.
-
getDataEntities
Gets the list of data entities associated with this prompt query file. This list can only ever contain a single element, usegetDataEntity()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
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.
-