org.molgenis.omx.decorators
Class MolgenisFileDecorator<E extends MolgenisFile>

java.lang.Object
  extended by org.molgenis.framework.db.MapperDecorator<E>
      extended by org.molgenis.omx.decorators.MolgenisFileDecorator<E>
Type Parameters:
E -
All Implemented Interfaces:
Mapper<E>

public class MolgenisFileDecorator<E extends MolgenisFile>
extends MapperDecorator<E>

Generic decorator for MOLGENIS files. These files are coupled to entities and stored in a user defined, verified place. The 'FileType' denotes the final placement folder. So for example, the storage location has been set to '/data/xgap', the deploy name is 'tomatodb', and an image is uploaded; it is stored as /data/xgap/tomatodb/myImg'. Note that the extension is stripped off the filename. This is stored as part of the MolgenisFile object, and used to serve out the file with the correct MIME type, obtained at runtime.

Author:
joerivandervelde

Field Summary
protected  boolean strict
           
 
Constructor Summary
MolgenisFileDecorator(Mapper<E> generatedMapper)
           
 
Method Summary
 int add(List<E> entities)
           
 void genericAddUpdateChecks(List<E> entities)
           
 int remove(List<E> entities)
           
 int update(List<E> entities)
           
 
Methods inherited from class org.molgenis.framework.db.MapperDecorator
add, count, create, createFindSqlInclRules, createList, executeAdd, executeRemove, executeUpdate, find, find, find, findById, getDatabase, getFieldType, getTableFieldName, remove, resolveForeignKeys, toList, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strict

protected boolean strict
Constructor Detail

MolgenisFileDecorator

public MolgenisFileDecorator(Mapper<E> generatedMapper)
Method Detail

genericAddUpdateChecks

public void genericAddUpdateChecks(List<E> entities)
                            throws DatabaseException
Throws:
DatabaseException

add

public int add(List<E> entities)
        throws DatabaseException
Specified by:
add in interface Mapper<E extends MolgenisFile>
Overrides:
add in class MapperDecorator<E extends MolgenisFile>
Throws:
DatabaseException

update

public int update(List<E> entities)
           throws DatabaseException
Specified by:
update in interface Mapper<E extends MolgenisFile>
Overrides:
update in class MapperDecorator<E extends MolgenisFile>
Throws:
DatabaseException

remove

public int remove(List<E> entities)
           throws DatabaseException
Specified by:
remove in interface Mapper<E extends MolgenisFile>
Overrides:
remove in class MapperDecorator<E extends MolgenisFile>
Throws:
DatabaseException


Copyright © 2013. All Rights Reserved.