Revision 7926676f
Added by Anahit Babadshanjan almost 16 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/CommonServiceImpl.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import org.apache.log4j.Logger; |
19 | 19 |
import org.springframework.beans.factory.annotation.Autowired; |
20 |
import org.springframework.beans.factory.annotation.Qualifier; |
|
20 | 21 |
import org.springframework.stereotype.Service; |
21 | 22 |
import org.springframework.transaction.annotation.Transactional; |
22 | 23 |
|
... | ... | |
33 | 34 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
34 | 35 |
import eu.etaxonomy.cdm.model.media.Media; |
35 | 36 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus; |
37 |
import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao; |
|
36 | 38 |
import eu.etaxonomy.cdm.persistence.dao.common.IOriginalSourceDao; |
37 | 39 |
import eu.etaxonomy.cdm.persistence.dao.occurrence.IOccurrenceDao; |
38 | 40 |
import eu.etaxonomy.cdm.persistence.dao.common.IRepresentationDao; |
... | ... | |
44 | 46 |
public class CommonServiceImpl extends ServiceBase<CdmBase> implements ICommonService { |
45 | 47 |
private static final Logger logger = Logger.getLogger(CommonServiceImpl.class); |
46 | 48 |
|
49 |
// @Autowired |
|
50 |
// @Qualifier("cdmDao") |
|
51 |
// protected void setDao(ICdmEntityDao dao) { |
|
52 |
// this.dao = dao; |
|
53 |
// } |
|
54 |
|
|
55 |
// @Autowired |
|
56 |
// @Qualifier("cdmDao") |
|
57 |
// ICdmEntityDao dao; |
|
58 |
|
|
47 | 59 |
@Autowired |
48 | 60 |
IOriginalSourceDao originalSourceDao; |
49 | 61 |
|
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IService.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.cdm.api.service; |
11 | 11 |
|
12 | 12 |
|
13 |
import java.util.List; |
|
14 |
|
|
13 | 15 |
import org.springframework.transaction.annotation.Propagation; |
14 | 16 |
import org.springframework.transaction.annotation.Transactional; |
15 | 17 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
16 | 18 |
import eu.etaxonomy.cdm.model.common.Language; |
19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
17 | 20 |
|
18 | 21 |
|
19 | 22 |
/** |
... | ... | |
25 | 28 |
|
26 | 29 |
public abstract int count(Class<T> clazz); |
27 | 30 |
|
31 |
public abstract List<T> list(int limit, int start); |
|
32 |
|
|
33 |
public abstract List<T> rows(String tableName, int limit, int start); |
|
34 |
|
|
28 | 35 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ServiceBase.java | ||
---|---|---|
17 | 17 |
import java.util.UUID; |
18 | 18 |
|
19 | 19 |
import org.apache.log4j.Logger; |
20 |
import org.springframework.beans.factory.annotation.Autowired; |
|
21 |
import org.springframework.beans.factory.annotation.Qualifier; |
|
20 | 22 |
import org.springframework.context.ApplicationContext; |
21 | 23 |
import org.springframework.context.ApplicationContextAware; |
22 | 24 |
import org.springframework.transaction.annotation.Transactional; |
... | ... | |
31 | 33 |
//flush after saving this number of objects |
32 | 34 |
int flushAfterNo = 2000; |
33 | 35 |
protected ApplicationContext appContext; |
36 |
|
|
37 |
@Autowired |
|
38 |
@Qualifier("cdmDao") |
|
34 | 39 |
protected ICdmEntityDao<T> dao; |
35 | 40 |
|
36 | 41 |
protected void setEntityDao(ICdmEntityDao<T> dao){ |
... | ... | |
97 | 102 |
return dao.delete(cdmObj); |
98 | 103 |
} |
99 | 104 |
|
100 |
protected List<T> list(int limit, int start) {
|
|
105 |
public List<T> list(int limit, int start) {
|
|
101 | 106 |
return dao.list(limit, start); |
102 | 107 |
} |
103 | 108 |
|
109 |
public List<T> rows(String tableName, int limit, int start) { |
|
110 |
return dao.rows(tableName, limit, start); |
|
111 |
} |
|
104 | 112 |
} |
Also available in: Unified diff
Experimented with comparing content of two CDM databases