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 void
checkDefinitionStoreBinding(FileInfoDefinition fileInfoDefinition)
Check this store is the good one for this definition.protected void
checkReadonly()
Check readonly.FileInfo
create(FileInfo fileInfo)
Save a file.void
delete(FileInfoURI fileInfoUri)
Delete a file.protected static EntityStoreManager
getEntityStoreManager()
Class<? extends FileInfo>
getFileInfoClass()
Get's the FileInfo Class that are handled by the particular pluginString
getFileInfoClassName()
String
getName()
protected static <V> V
getValue(DtObject dto, DtFieldName fieldName, Class<V> valueClass)
Retourne une valeur d'un champ à partir du DtObject.FileInfo
read(FileInfoURI fileInfoUri)
Load a file by its URI.protected static void
setIdValue(DtObject dto, FileInfoURI uri)
protected static void
setValue(DtObject dto, DtFieldName fieldName, Object value)
Fixe une valeur d'un champ d'un DtObject.void
update(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:
read
in 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:
create
in 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:
update
in interfaceFileStorePlugin
- Parameters:
fileInfo
- File to save (modification)
-
delete
public void delete(FileInfoURI fileInfoUri)
Delete a file.- Specified by:
delete
in interfaceFileStorePlugin
- Parameters:
fileInfoUri
- File's URI to remove
-
getFileInfoClass
public Class<? extends FileInfo> getFileInfoClass()
Description copied from interface:FileStorePlugin
Get's the FileInfo Class that are handled by the particular plugin- Specified by:
getFileInfoClass
in 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
-
-