Revision f1a25720
Added by Katja Luther over 6 years ago
- ID f1a25720755daa96e8838a617a660dfced7b9f31
- Parent 23e50194
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VersionableEntity.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.model.common; |
11 | 11 |
|
12 |
import java.time.ZonedDateTime; |
|
12 | 13 |
import java.util.HashMap; |
13 | 14 |
import java.util.Map; |
14 | 15 |
import java.util.UUID; |
... | ... | |
31 | 32 |
import org.hibernate.search.annotations.Analyze; |
32 | 33 |
import org.hibernate.search.annotations.Field; |
33 | 34 |
import org.hibernate.search.annotations.FieldBridge; |
34 |
import org.joda.time.DateTime; |
|
35 | 35 |
|
36 | 36 |
import eu.etaxonomy.cdm.common.CdmUtils; |
37 |
import eu.etaxonomy.cdm.hibernate.search.DateTimeBridge; |
|
37 |
import eu.etaxonomy.cdm.hibernate.search.ZonedDateTimeBridge;
|
|
38 | 38 |
import eu.etaxonomy.cdm.jaxb.DateTimeAdapter; |
39 | 39 |
import eu.etaxonomy.cdm.strategy.match.Match; |
40 | 40 |
import eu.etaxonomy.cdm.strategy.match.MatchMode; |
... | ... | |
59 | 59 |
"updated", |
60 | 60 |
"updatedBy" |
61 | 61 |
}) |
62 |
@XmlJavaTypeAdapter(value=DateTimeAdapter.class,type=DateTime.class) |
|
62 |
@XmlJavaTypeAdapter(value=DateTimeAdapter.class,type=ZonedDateTime.class)
|
|
63 | 63 |
@MappedSuperclass |
64 | 64 |
@Audited |
65 | 65 |
public abstract class VersionableEntity extends CdmBase implements IVersionableEntity{ |
... | ... | |
71 | 71 |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
72 | 72 |
//@XmlElement(name ="Updated") |
73 | 73 |
//@XmlElement(name ="Updated") |
74 |
@Type(type="dateTimeUserType") |
|
74 |
// @Type(type="dateTimeUserType") |
|
75 |
@Type(type="org.hibernate.type.ZonedDateTimeType") |
|
75 | 76 |
@Basic(fetch = FetchType.LAZY) |
76 | 77 |
@Match(MatchMode.IGNORE) |
77 | 78 |
@Field(analyze = Analyze.NO) |
78 |
@FieldBridge(impl = DateTimeBridge.class) |
|
79 |
private DateTime updated; |
|
79 |
@FieldBridge(impl = ZonedDateTimeBridge.class)
|
|
80 |
private ZonedDateTime updated;
|
|
80 | 81 |
|
81 | 82 |
@XmlElement(name = "UpdatedBy") |
82 | 83 |
@XmlIDREF |
... | ... | |
104 | 105 |
* @return |
105 | 106 |
*/ |
106 | 107 |
@Override |
107 |
public DateTime getUpdated(){ |
|
108 |
public ZonedDateTime getUpdated(){
|
|
108 | 109 |
return this.updated; |
109 | 110 |
} |
110 | 111 |
|
... | ... | |
113 | 114 |
* @param updated updated |
114 | 115 |
*/ |
115 | 116 |
@Override |
116 |
public void setUpdated(DateTime updated){ |
|
117 |
public void setUpdated(ZonedDateTime updated){
|
|
117 | 118 |
this.updated = updated; |
118 | 119 |
} |
119 | 120 |
|
Also available in: Unified diff
first implementation for change from joda time to java8 time