Revision f1a25720
Added by Katja Luther over 6 years ago
- ID f1a25720755daa96e8838a617a660dfced7b9f31
- Parent 23e50194
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/PersistentTermInitializer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.database; |
11 | 11 |
|
12 |
import java.time.Duration; |
|
13 |
import java.time.ZonedDateTime; |
|
12 | 14 |
import java.util.HashMap; |
13 | 15 |
import java.util.Map; |
14 | 16 |
import java.util.Set; |
... | ... | |
18 | 20 |
|
19 | 21 |
import org.apache.log4j.Logger; |
20 | 22 |
import org.hibernate.Hibernate; |
21 |
import org.joda.time.DateTime; |
|
22 |
import org.joda.time.Period; |
|
23 | 23 |
import org.springframework.beans.factory.annotation.Autowired; |
24 | 24 |
import org.springframework.stereotype.Component; |
25 | 25 |
import org.springframework.transaction.PlatformTransactionManager; |
... | ... | |
104 | 104 |
Map<UUID,DefinedTermBase> terms = new HashMap<UUID,DefinedTermBase>(); |
105 | 105 |
logger.info("PersistentTermInitializer.omit == false, initializing " + VocabularyEnum.values().length + " term classes"); |
106 | 106 |
|
107 |
DateTime start = new DateTime();
|
|
107 |
ZonedDateTime start = ZonedDateTime.now();
|
|
108 | 108 |
|
109 | 109 |
TransactionStatus txStatus = transactionManager.getTransaction(txDefinition); |
110 | 110 |
|
... | ... | |
151 | 151 |
|
152 | 152 |
transactionManager.commit(txStatus); |
153 | 153 |
|
154 |
DateTime end = new DateTime();
|
|
155 |
Period period = new Period(start, end);
|
|
156 |
logger.info ("Term loading took " + period.getSeconds() + "." + period.getMillis() + " seconds ");
|
|
154 |
ZonedDateTime end = ZonedDateTime.now();
|
|
155 |
Duration period = Duration.between(start.toLocalDateTime(), end.toLocalDateTime());
|
|
156 |
logger.info ("Term loading took " + period.getSeconds() + "." + period.getNano() + " seconds ");
|
|
157 | 157 |
|
158 | 158 |
} |
159 | 159 |
logger.info("PersistentTermInitializer initialize end ..."); |
Also available in: Unified diff
first implementation for change from joda time to java8 time