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 aPromptQueryFileEntity. Each prompt query containsMap<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 Constructor Description PromptQueryFileEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PromptQueryEntitygetBaseEntity()Gets the prompt query entity that contains this file.InstantgetCreatedInstant()Gets the point in time when this file was originally created.StringgetCreatorName()Gets the name of the user who originally created this file.protected List<PromptQueryFileDataEntity>getDataEntities()Gets the list of data entities associated with this prompt query file.PromptQueryFileDataEntitygetDataEntity()Gets the single associated data entity holding the actual binary data of the file.intgetFileIndex()The file index of this prompt query file.StringgetFileKey()Gets the key that determines the purpose of this fileStringgetFileName()Gets the name of the file.intgetFileSize()Gets the size of the file in bytes, i.e. the number of bytes of the data stored in the associateddata entity.LonggetId()Gets the database ID of this prompt query file.StringgetMimeType()Gets the mime type of this file, i.e. a string like "image/png" or "application/pdf".InstantgetModifiedInstant()Gets the point in time when this file was last modified.StringgetModifierName()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.voidsetId(Long id)Sets 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.
-
-
-
Method Detail
-
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 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
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 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
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 associateddata 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, 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
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.
-
-