3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.cdm
.io
.common
.mapping
;
13 import java
.sql
.ResultSet
;
14 import java
.sql
.SQLException
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.io
.common
.DbImportStateBase
;
19 import eu
.etaxonomy
.cdm
.model
.common
.AnnotatableEntity
;
26 public class DbImportObjectCreationMapper
<ANNOTATABLE
extends AnnotatableEntity
, STATE
extends DbImportStateBase
<?
,?
>> extends DbImportObjectCreationMapperBase
<ANNOTATABLE
, STATE
> {
27 @SuppressWarnings("unused")
28 private static final Logger logger
= Logger
.getLogger(DbImportObjectCreationMapper
.class);
30 //******************************** FACTORY METHOD ***************************************************/
32 public static DbImportObjectCreationMapper
<?
,?
> NewInstance(IMappingImport mappingImport
, String dbIdAttribute
, String namespace
){
33 return new DbImportObjectCreationMapper(mappingImport
, dbIdAttribute
, namespace
);
36 //******************************* ATTRIBUTES ***************************************/
37 private IMappingImport
<ANNOTATABLE
, STATE
> mappingImport
;
40 //********************************* CONSTRUCTOR ****************************************/
42 * @param mappingImport
44 protected DbImportObjectCreationMapper(IMappingImport
<ANNOTATABLE
, STATE
> mappingImport
, String dbIdAttribute
, String objectToCreateNamespace
) {
45 super(dbIdAttribute
, objectToCreateNamespace
);
46 this.mappingImport
= mappingImport
;
49 //************************************ METHODS *******************************************/
53 * @see eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase#doInvoke(java.sql.ResultSet, eu.etaxonomy.cdm.model.common.VersionableEntity)
56 protected ANNOTATABLE
doInvoke(ResultSet rs
, ANNOTATABLE createdObject
) throws SQLException
{
62 * @see eu.etaxonomy.cdm.io.common.mapping.DbImportObjectCreationMapperBase#createObject(java.sql.ResultSet)
65 protected ANNOTATABLE
createObject(ResultSet rs
) throws SQLException
{
66 ANNOTATABLE result
= mappingImport
.createObject(rs
, importMapperHelper
.getState());