Skip to content

Commit 1bfdc12

Browse files
committed
Merge remote-tracking branch 'remotes/origin/dev'
2 parents d098449 + 300c619 commit 1bfdc12

File tree

12 files changed

+458
-449
lines changed

12 files changed

+458
-449
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<properties>
4848
<bundlor.enabled>false</bundlor.enabled>
4949
<bundlor.failOnWarnings>false</bundlor.failOnWarnings>
50-
<springdata.commons>2.0.4.RELEASE</springdata.commons>
50+
<springdata.commons>1.13.10.RELEASE</springdata.commons>
5151
<ebean.version>11.10.6</ebean.version>
5252
<ebean-spring-txn.version>11.10.3</ebean-spring-txn.version>
5353
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
@@ -189,6 +189,11 @@
189189
<artifactId>spring-test</artifactId>
190190
<scope>test</scope>
191191
</dependency>
192+
<dependency>
193+
<groupId>joda-time</groupId>
194+
<artifactId>joda-time</artifactId>
195+
<version>2.9.7</version>
196+
</dependency>
192197

193198

194199
</dependencies>

src/main/java/org/springframework/data/ebean/domain/AbstractEntity.java

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@
2020
import io.ebean.annotation.UpdatedTimestamp;
2121
import io.ebean.annotation.WhoCreated;
2222
import io.ebean.annotation.WhoModified;
23+
import javax.persistence.Id;
24+
import javax.persistence.MappedSuperclass;
25+
import javax.persistence.Transient;
26+
import org.joda.time.DateTime;
2327
import org.springframework.data.domain.Auditable;
2428
import org.springframework.data.domain.Persistable;
2529
import org.springframework.util.ClassUtils;
2630

27-
import javax.persistence.Id;
28-
import javax.persistence.MappedSuperclass;
29-
import javax.persistence.Transient;
30-
import java.time.LocalDateTime;
31-
import java.util.Optional;
3231

3332
/**
3433
* Abstract base class for entities.
@@ -37,7 +36,7 @@
3736
* @author Xuegui Yuan
3837
*/
3938
@MappedSuperclass
40-
public abstract class AbstractEntity implements Persistable<Long>, Auditable<String, Long, LocalDateTime> {
39+
public abstract class AbstractEntity implements Persistable<Long>, Auditable<String, Long> {
4140

4241
private static final long serialVersionUID = -5554308939380869754L;
4342

@@ -48,19 +47,29 @@ public abstract class AbstractEntity implements Persistable<Long>, Auditable<Str
4847
String createdBy;
4948

5049
@CreatedTimestamp
51-
LocalDateTime createdDate;
50+
DateTime createdDate;
5251

5352
@WhoModified
5453
String lastModifiedBy;
5554

5655
@UpdatedTimestamp
57-
LocalDateTime lastModifiedDate;
56+
DateTime lastModifiedDate;
57+
58+
@Override
59+
public String getCreatedBy() {
60+
return createdBy;
61+
}
5862

5963
@Override
6064
public Long getId() {
6165
return id;
6266
}
6367

68+
@Override
69+
public void setCreatedBy(String createdBy) {
70+
this.createdBy = createdBy;
71+
}
72+
6473
/**
6574
* Sets the id of the entity.
6675
*
@@ -70,35 +79,25 @@ public void setId(final Long id) {
7079
this.id = id;
7180
}
7281

73-
@Transient
7482
@Override
75-
public boolean isNew() {
76-
return null == getId();
77-
}
78-
79-
@Override
80-
public Optional<String> getCreatedBy() {
81-
return Optional.ofNullable(createdBy);
82-
}
83-
84-
@Override
85-
public void setCreatedBy(String createdBy) {
86-
this.createdBy = createdBy;
83+
public DateTime getCreatedDate() {
84+
return createdDate;
8785
}
8886

87+
@Transient
8988
@Override
90-
public Optional<LocalDateTime> getCreatedDate() {
91-
return Optional.ofNullable(createdDate);
89+
public boolean isNew() {
90+
return null == getId();
9291
}
9392

9493
@Override
95-
public void setCreatedDate(LocalDateTime createdDate) {
94+
public void setCreatedDate(DateTime createdDate) {
9695
this.createdDate = createdDate;
9796
}
9897

9998
@Override
100-
public Optional<String> getLastModifiedBy() {
101-
return Optional.ofNullable(lastModifiedBy);
99+
public String getLastModifiedBy() {
100+
return lastModifiedBy;
102101
}
103102

104103
@Override
@@ -107,21 +106,15 @@ public void setLastModifiedBy(String lastModifiedBy) {
107106
}
108107

109108
@Override
110-
public Optional<LocalDateTime> getLastModifiedDate() {
111-
return Optional.ofNullable(lastModifiedDate);
109+
public DateTime getLastModifiedDate() {
110+
return lastModifiedDate;
112111
}
113112

114113
@Override
115-
public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
114+
public void setLastModifiedDate(DateTime lastModifiedDate) {
116115
this.lastModifiedDate = lastModifiedDate;
117116
}
118117

119-
120-
/*
121-
* (non-Javadoc)
122-
*
123-
* @see java.lang.Object#hashCode()
124-
*/
125118
@Override
126119
public int hashCode() {
127120
int hashCode = 17;

src/main/java/org/springframework/data/ebean/repository/EbeanRepository.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@
1919
import io.ebean.EbeanServer;
2020
import io.ebean.SqlUpdate;
2121
import io.ebean.UpdateQuery;
22-
import org.springframework.data.domain.*;
22+
import java.io.Serializable;
23+
import java.util.List;
24+
import org.springframework.data.domain.Example;
25+
import org.springframework.data.domain.Page;
26+
import org.springframework.data.domain.Pageable;
27+
import org.springframework.data.domain.Persistable;
28+
import org.springframework.data.domain.Sort;
2329
import org.springframework.data.repository.NoRepositoryBean;
2430
import org.springframework.data.repository.PagingAndSortingRepository;
2531
import org.springframework.data.repository.query.QueryByExampleExecutor;
2632

27-
import java.io.Serializable;
28-
import java.util.List;
29-
3033
/**
3134
* Ebean specific extension of {@link org.springframework.data.repository.Repository}.
3235
*
@@ -106,7 +109,6 @@ public interface EbeanRepository<T extends Persistable, ID extends Serializable>
106109
* @param ids Id list
107110
* @return List
108111
*/
109-
@Override
110112
List<T> findAllById(Iterable<ID> ids);
111113

112114
/**

src/main/java/org/springframework/data/ebean/repository/config/EbeanRepositoryConfigExtension.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@
1616

1717
package org.springframework.data.ebean.repository.config;
1818

19-
import org.springframework.dao.DataAccessException;
20-
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
21-
import org.springframework.data.ebean.repository.EbeanRepository;
22-
import org.springframework.data.ebean.repository.support.EbeanRepositoryFactoryBean;
23-
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
24-
25-
import javax.persistence.Entity;
26-
import javax.persistence.MappedSuperclass;
2719
import java.lang.annotation.Annotation;
2820
import java.util.Arrays;
2921
import java.util.Collection;
3022
import java.util.Collections;
3123
import java.util.Locale;
24+
import javax.persistence.Entity;
25+
import javax.persistence.MappedSuperclass;
26+
import org.springframework.dao.DataAccessException;
27+
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
28+
import org.springframework.data.ebean.repository.EbeanRepository;
29+
import org.springframework.data.ebean.repository.support.EbeanRepositoryFactoryBean;
30+
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
3231

3332
/**
3433
* Ebean specific configuration extension parsing custom attributes from the XML namespace and
@@ -47,8 +46,12 @@ public class EbeanRepositoryConfigExtension extends RepositoryConfigurationExten
4746
* (non-Javadoc)
4847
* @see org.springframework.data.repository.config.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
4948
*/
49+
// public String getRepositoryFactoryBeanClassName() {
50+
// return EbeanRepositoryFactoryBean.class.getName();
51+
// }
52+
5053
@Override
51-
public String getRepositoryFactoryBeanClassName() {
54+
public String getRepositoryFactoryClassName() {
5255
return EbeanRepositoryFactoryBean.class.getName();
5356
}
5457

src/main/java/org/springframework/data/ebean/repository/query/EbeanQueryCreator.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import io.ebean.Expression;
2121
import io.ebean.ExpressionList;
2222
import io.ebean.Query;
23+
import java.util.Collection;
24+
import java.util.Iterator;
25+
import java.util.List;
2326
import org.springframework.data.domain.Sort;
2427
import org.springframework.data.mapping.PropertyPath;
2528
import org.springframework.data.repository.query.ReturnedType;
@@ -28,10 +31,6 @@
2831
import org.springframework.data.repository.query.parser.PartTree;
2932
import org.springframework.util.Assert;
3033

31-
import java.util.Collection;
32-
import java.util.Iterator;
33-
import java.util.List;
34-
3534
/**
3635
* EbeanQueryWrapper creator to create a {@link io.ebean.Expression} from a {@link PartTree}.
3736
*
@@ -199,10 +198,10 @@ public Expression build() {
199198
ParameterMetadataProvider.ParameterMetadata<Object> pmNot = provider.next(part);
200199
return pmNot.isIsNullParameter() ? Expr.isNull(property.toDotPath())
201200
: Expr.ne(property.toDotPath(), pmNot.getParameterValue());
202-
case IS_EMPTY:
203-
return Expr.isEmpty(property.toDotPath());
204-
case IS_NOT_EMPTY:
205-
return Expr.isNotEmpty(property.toDotPath());
201+
// case IS_EMPTY:
202+
// return Expr.isEmpty(property.toDotPath());
203+
// case IS_NOT_EMPTY:
204+
// return Expr.isNotEmpty(property.toDotPath());
206205
default:
207206
throw new IllegalArgumentException("Unsupported keyword " + type);
208207
}

0 commit comments

Comments
 (0)