Class TwoTablesDbFileStorePlugin
- java.lang.Object
-
- io.vertigo.datastore.plugins.filestore.db.TwoTablesDbFileStorePlugin
-
- All Implemented Interfaces:
io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin,FileStorePlugin
public final class TwoTablesDbFileStorePlugin extends Object implements FileStorePlugin
Permet de gérer le CRUD sur un fichier stocké sur deux tables (Méta données / Données).- Author:
- sezratty
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDefinitionStoreBinding(FileInfoDefinition fileInfoDefinition)Check this store is the good one for this definition.protected voidcheckReadonly()Check readonly.FileInfocreate(FileInfo fileInfo)Save a file.voiddelete(FileInfoURI fileInfoUri)Delete a file.protected static EntityStoreManagergetEntityStoreManager()Class<? extends FileInfo>getFileInfoClass()Get's the FileInfo Class that are handled by the particular pluginStringgetFileInfoClassName()StringgetName()protected static <V> VgetValue(DtObject dto, DtFieldName fieldName, Class<V> valueClass)Retourne une valeur d'un champ à partir du DtObject.FileInforead(FileInfoURI fileInfoUri)Load a file by its URI.protected static voidsetIdValue(DtObject dto, FileInfoURI uri)protected static voidsetValue(DtObject dto, DtFieldName fieldName, Object value)Fixe une valeur d'un champ d'un DtObject.voidupdate(FileInfo fileInfo)Save a file.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertigo.datastore.impl.filestore.FileStorePlugin
getName
-
-
-
-
Constructor Detail
-
TwoTablesDbFileStorePlugin
@Inject public TwoTablesDbFileStorePlugin(Optional<String> name, String storeMetaDataDtDefinitionName, String storeFileDtDefinitionName, String fileInfoClassName)
Constructor.- Parameters:
name- This store namestoreMetaDataDtDefinitionName- MetaData storing dtDefinitionstoreFileDtDefinitionName- File storing dtDefinition
-
-
Method Detail
-
read
public FileInfo read(FileInfoURI fileInfoUri)
Load a file by its URI.- Specified by:
readin interfaceFileStorePlugin- Parameters:
fileInfoUri- FileURI requested- Returns:
- FileInfo for this uri (null if not found).
-
create
public FileInfo create(FileInfo fileInfo)
Save a file. Input FileInfo must have an empty URI : insert mode- Specified by:
createin interfaceFileStorePlugin- Parameters:
fileInfo- File to save (creation)- Returns:
- the created FileInfo
-
update
public void update(FileInfo fileInfo)
Save a file. Input FileInfo must have an URI : update mode- Specified by:
updatein interfaceFileStorePlugin- Parameters:
fileInfo- File to save (modification)
-
delete
public void delete(FileInfoURI fileInfoUri)
Delete a file.- Specified by:
deletein interfaceFileStorePlugin- Parameters:
fileInfoUri- File's URI to remove
-
getFileInfoClass
public Class<? extends FileInfo> getFileInfoClass()
Description copied from interface:FileStorePluginGet's the FileInfo Class that are handled by the particular plugin- Specified by:
getFileInfoClassin interfaceFileStorePlugin- Returns:
-
getName
public String getName()
- Returns:
- This store name
-
getFileInfoClassName
public String getFileInfoClassName()
- Returns:
- the fileInfo className
-
checkReadonly
protected void checkReadonly()
Check readonly.
-
checkDefinitionStoreBinding
protected void checkDefinitionStoreBinding(FileInfoDefinition fileInfoDefinition)
Check this store is the good one for this definition.- Parameters:
fileInfoDefinition- Definition du FileInfo
-
getValue
protected static <V> V getValue(DtObject dto, DtFieldName fieldName, Class<V> valueClass)
Retourne une valeur d'un champ à partir du DtObject.- Type Parameters:
V- Type de la valeur *- Parameters:
dto- DtObjectfieldName- Nom du champvalueClass- Type du champ- Returns:
- Valeur typé du champ
-
setValue
protected static void setValue(DtObject dto, DtFieldName fieldName, Object value)
Fixe une valeur d'un champ d'un DtObject.- Parameters:
dto- DtObjectfieldName- Nom du champsvalue- Valeur
-
setIdValue
protected static void setIdValue(DtObject dto, FileInfoURI uri)
- Parameters:
dto- DtObjectvalue- Pk value
-
getEntityStoreManager
protected static EntityStoreManager getEntityStoreManager()
- Returns:
- StoreManager
-
-