eu.etaxonomy.cdm.io.common.mapping
Class DbImportExtensionCreationMapper
java.lang.Object
eu.etaxonomy.cdm.io.common.mapping.CdmMapperBase
eu.etaxonomy.cdm.io.common.mapping.CdmAttributeMapperBase
eu.etaxonomy.cdm.io.common.mapping.MultipleAttributeMapperBase<CdmSingleAttributeMapperBase>
eu.etaxonomy.cdm.io.common.mapping.DbImportMultiAttributeMapperBase<CREATE,STATE>
eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase<SUPPLEMENT,STATE>
eu.etaxonomy.cdm.io.common.mapping.DbImportSupplementCreationMapperBase<Extension,IdentifiableEntity,DbImportStateBase<?,?>,ExtensionType>
eu.etaxonomy.cdm.io.common.mapping.DbImportExtensionCreationMapper
- All Implemented Interfaces:
- IDbImportMapper<DbImportStateBase<?,?>,Extension>
public class DbImportExtensionCreationMapper
- extends DbImportSupplementCreationMapperBase<Extension,IdentifiableEntity,DbImportStateBase<?,?>,ExtensionType>
Object creation mapper which creates a extensions.
- Version:
- 1.0
- Author:
- a.mueller
DbImportExtensionCreationMapper
protected DbImportExtensionCreationMapper(String dbSupplementedObjectAttribute,
String supplementedObjectNamespace,
String dbSupplementValueAttribute,
String dbIdAttribute,
ExtensionType supplementType)
NewInstance
public static DbImportExtensionCreationMapper NewInstance(String dbExtendedObjectAttribute,
String extendedObjectNamespace)
- Creates an extension mapper which creates an empty extension.
- Parameters:
dbExtendedObjectAttribute - the database column that holds the foreign key for the extended object - obligatoryextendedObjectNamespace - the namespace under which the extended object has been saved previously - obligatory
- Returns:
- DbImportExtensionCreationMapper
NewInstance
public static DbImportExtensionCreationMapper NewInstance(String dbExtendedObjectAttribute,
String extendedObjectNamespace,
String dbExtensionValueAttribute,
String dbIdAttribute,
ExtensionType extensionType)
- Creates an extension mapper which creates an extension and sets the extension value,
the extension type and adds an annotation holding the original source id
- Parameters:
dbExtendedObjectAttribute - the database column that holds the foreign key for the extended object - obligatoryextendedObjectNamespace - the namespace under which the extended object has been saved previously - obligatorydbExtensionValueAttribute - if null no extension value is setdbIdAttribute - if null not original source id annotation is addedextensionType - if null no extension type is set
- Returns:
- DbImportExtensionCreationMapper
addSupplement
protected boolean addSupplement(Extension extension,
IdentifiableEntity identifiableEntity,
String id)
- Description copied from class:
DbImportSupplementCreationMapperBase
- Adds the supplement to the supplementable entity. Returns falls if supplementable entity is
null
- Specified by:
addSupplement in class DbImportSupplementCreationMapperBase<Extension,IdentifiableEntity,DbImportStateBase<?,?>,ExtensionType>
- Parameters:
extension - the supplement (e.g. an instance of class Extension)identifiableEntity - the supplementable entity (e.g. an IdentifiableEntity in case of a
supplement of type Extensionid - the supplementableEntity original source id (needed for verbose logging)
setSupplementValue
protected void setSupplementValue(ResultSet rs,
Extension extension)
throws SQLException
- Specified by:
setSupplementValue in class DbImportSupplementCreationMapperBase<Extension,IdentifiableEntity,DbImportStateBase<?,?>,ExtensionType>
- Throws:
SQLException
createObject
protected Extension createObject(ResultSet rs)
throws SQLException
- Description copied from class:
DbImportObjectCreationMapperBase
- This method creates the object to be created. It needs to be implemented by the concrete classes.
E.g. if you have a TaxonNameCreation class which inherits from this class you need to implement
createObject by creating an empty taxon name.
- Specified by:
createObject in class DbImportObjectCreationMapperBase<Extension,DbImportStateBase<?,?>>
- Parameters:
rs - The result set
- Returns:
- The object to be created
- Throws:
SQLException
Copyright © 2007-2013 EDIT. All Rights Reserved.