eu.etaxonomy.cdm.io.common.mapping
Class DbImportSupplementCreationMapperBase<SUPPLEMENT extends VersionableEntity,SUPPLEMENTABLE extends AnnotatableEntity,STATE extends DbImportStateBase<?,?>,TYPE extends DefinedTermBase>

java.lang.Object
  extended by eu.etaxonomy.cdm.io.common.mapping.CdmMapperBase
      extended by eu.etaxonomy.cdm.io.common.mapping.CdmAttributeMapperBase
          extended by eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase<CdmSingleAttributeMapperBase>
              extended by eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase<CREATE,STATE>
                  extended by eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase<SUPPLEMENT,STATE>
                      extended by eu.etaxonomy.cdm.io.common.mapping.DbImportSupplementCreationMapperBase<SUPPLEMENT,SUPPLEMENTABLE,STATE,TYPE>
All Implemented Interfaces:
IDbImportMapper<STATE,SUPPLEMENT>
Direct Known Subclasses:
DbImportAnnotationCreationMapper, DbImportExtensionCreationMapper, DbImportMarkerCreationMapper

public abstract class DbImportSupplementCreationMapperBase<SUPPLEMENT extends VersionableEntity,SUPPLEMENTABLE extends AnnotatableEntity,STATE extends DbImportStateBase<?,?>,TYPE extends DefinedTermBase>
extends DbImportObjectCreationMapperBase<SUPPLEMENT,STATE>

Version:
1.0
Author:
a.mueller

Field Summary
protected  boolean addOriginalSourceId
           
protected  String dbSupplementedObjectAttribute
           
protected  String dbSupplementValueAttribute
           
protected  TYPE supplementType
           
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase
dbIdAttribute, objectToCreateNamespace
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase
importMapperHelper
 
Fields inherited from class eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase
singleMappers
 
Constructor Summary
protected DbImportSupplementCreationMapperBase(String dbSupplementValueAttribute, String dbSupplementedObjectAttribute, String dbIdAttribute, String supplementedObjectNamespace, TYPE supplementType)
           
 
Method Summary
 void addOriginalSource(ResultSet rs, SUPPLEMENT supplement)
          TODO also implemented in CdmImportBase (reduce redundance)
protected abstract  boolean addSupplement(SUPPLEMENT supplement, SUPPLEMENTABLE supplementableEntity, String id)
          Adds the supplement to the supplementable entity.
protected  SUPPLEMENT doInvoke(ResultSet rs, SUPPLEMENT supplement)
           
protected abstract  void setSupplementValue(ResultSet rs, SUPPLEMENT supplement)
           
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase
createObject, getTransformer, invoke
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase
getForeignKey, getRelatedObject, getRelatedObject, getState, initialize
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase
getDestinationAttributeList, getDestinationAttributes, getSourceAttributeList, getSourceAttributes, getStringDbValue
 
Methods inherited from class eu.etaxonomy.cdm.io.common.mapping.CdmAttributeMapperBase
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dbSupplementValueAttribute

protected String dbSupplementValueAttribute

dbSupplementedObjectAttribute

protected String dbSupplementedObjectAttribute

supplementType

protected TYPE extends DefinedTermBase supplementType

addOriginalSourceId

protected boolean addOriginalSourceId
Constructor Detail

DbImportSupplementCreationMapperBase

protected DbImportSupplementCreationMapperBase(String dbSupplementValueAttribute,
                                               String dbSupplementedObjectAttribute,
                                               String dbIdAttribute,
                                               String supplementedObjectNamespace,
                                               TYPE supplementType)
Parameters:
mappingImport -
Method Detail

doInvoke

protected SUPPLEMENT doInvoke(ResultSet rs,
                              SUPPLEMENT supplement)
                                                 throws SQLException
Specified by:
doInvoke in class DbImportObjectCreationMapperBase<SUPPLEMENT extends VersionableEntity,STATE extends DbImportStateBase<?,?>>
Throws:
SQLException

setSupplementValue

protected abstract void setSupplementValue(ResultSet rs,
                                           SUPPLEMENT supplement)
                                    throws SQLException
Parameters:
value -
Throws:
SQLException

addSupplement

protected abstract boolean addSupplement(SUPPLEMENT supplement,
                                         SUPPLEMENTABLE supplementableEntity,
                                         String id)
Adds the supplement to the supplementable entity. Returns falls if supplementable entity is null

Parameters:
supplement - the supplement (e.g. an instance of class Extension)
supplementableEntity - the supplementable entity (e.g. an IdentifiableEntity in case of a supplement of type Extension
id - the supplementableEntity original source id (needed for verbose logging)

addOriginalSource

public void addOriginalSource(ResultSet rs,
                              SUPPLEMENT supplement)
                       throws SQLException
Description copied from class: DbImportObjectCreationMapperBase
TODO also implemented in CdmImportBase (reduce redundance)

Overrides:
addOriginalSource in class DbImportObjectCreationMapperBase<SUPPLEMENT extends VersionableEntity,STATE extends DbImportStateBase<?,?>>
Throws:
SQLException


Copyright © 2007-2013 EDIT. All Rights Reserved.