Skip to content

Commit 2726784

Browse files
committed
Merge branch 'dev'
2 parents 99a6e7d + 58dd277 commit 2726784

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1074
-921
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<parent>
77
<groupId>org.springframework.data.build</groupId>
88
<artifactId>spring-data-parent</artifactId>
9-
<version>2.0.2.RELEASE</version>
9+
<version>2.0.4.RELEASE</version>
1010
</parent>
1111

1212
<groupId>io.github.hexagonframework.data</groupId>
1313
<artifactId>spring-data-ebean</artifactId>
14-
<version>1.2.6.RELEASE</version>
14+
<version>1.2.7.SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<name>Spring Data Ebean</name>
@@ -47,9 +47,9 @@
4747
<properties>
4848
<bundlor.enabled>false</bundlor.enabled>
4949
<bundlor.failOnWarnings>false</bundlor.failOnWarnings>
50-
<springdata.commons>2.0.2.RELEASE</springdata.commons>
51-
<ebean.version>11.6.1</ebean.version>
52-
<ebean-spring-txn.version>10.1.1</ebean-spring-txn.version>
50+
<springdata.commons>2.0.4.RELEASE</springdata.commons>
51+
<ebean.version>11.10.6</ebean.version>
52+
<ebean-spring-txn.version>11.10.3</ebean-spring-txn.version>
5353
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
5454
</properties>
5555

src/main/java/org/springframework/data/ebean/annotation/Modifying.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2016 the original author or authors.
2+
* Copyright 2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,11 +16,7 @@
1616

1717
package org.springframework.data.ebean.annotation;
1818

19-
import java.lang.annotation.Documented;
20-
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Retention;
22-
import java.lang.annotation.RetentionPolicy;
23-
import java.lang.annotation.Target;
19+
import java.lang.annotation.*;
2420

2521
/**
2622
* Indicates a method should be regarded as Update{@link io.ebean.UpdateQuery} or SqlUpdate {@link io.ebean.SqlUpdate}.

src/main/java/org/springframework/data/ebean/annotation/Procedure.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2016 the original author or authors.
2+
* Copyright 2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,13 +16,10 @@
1616

1717
package org.springframework.data.ebean.annotation;
1818

19-
import java.lang.annotation.Documented;
20-
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Retention;
22-
import java.lang.annotation.RetentionPolicy;
23-
import java.lang.annotation.Target;
2419
import org.springframework.data.annotation.QueryAnnotation;
2520

21+
import java.lang.annotation.*;
22+
2623
/**
2724
* Annotation to declare stored procedure mappings directly on repository methods.
2825
*

src/main/java/org/springframework/data/ebean/annotation/Query.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2016 the original author or authors.
2+
* Copyright 2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,13 +16,10 @@
1616

1717
package org.springframework.data.ebean.annotation;
1818

19-
import java.lang.annotation.Documented;
20-
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Retention;
22-
import java.lang.annotation.RetentionPolicy;
23-
import java.lang.annotation.Target;
2419
import org.springframework.data.annotation.QueryAnnotation;
2520

21+
import java.lang.annotation.*;
22+
2623
/**
2724
* Annotation to declare finder queries directly on repository methods.
2825
*
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright 2017 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.data.ebean.domain;
18+
19+
import org.springframework.data.domain.AfterDomainEventPublication;
20+
import org.springframework.data.domain.DomainEvents;
21+
import org.springframework.util.Assert;
22+
23+
import javax.persistence.MappedSuperclass;
24+
import javax.persistence.Transient;
25+
import java.util.ArrayList;
26+
import java.util.Collection;
27+
import java.util.Collections;
28+
import java.util.List;
29+
30+
/**
31+
* Abstract base class for aggregate root, aggregate extends {@link AbstractEntity} and add
32+
* domain event functions.
33+
*
34+
* @author XueguiYuan
35+
*/
36+
@MappedSuperclass
37+
public abstract class AbstractAggregateRoot extends AbstractEntity {
38+
@Transient
39+
private transient final List<DomainEvent> domainEvents = new ArrayList<>();
40+
41+
/**
42+
* Registers the given event object for publication on a call to a Spring Data repository's save methods.
43+
*
44+
* @param event must not be {@literal null}.
45+
* @return the event that has been added.
46+
*/
47+
protected <T extends DomainEvent> T registerEvent(T event) {
48+
Assert.notNull(event, "Domain event must not be null!");
49+
50+
this.domainEvents.add(event);
51+
return event;
52+
}
53+
54+
/**
55+
* Clears all domain events currently held. Usually invoked by the infrastructure in place in Spring Data
56+
* repositories.
57+
*/
58+
@AfterDomainEventPublication
59+
protected void clearDomainEvents() {
60+
this.domainEvents.clear();
61+
}
62+
63+
/**
64+
* All domain events currently captured by the aggregate.
65+
*/
66+
@DomainEvents
67+
protected Collection<DomainEvent> domainEvents() {
68+
return Collections.unmodifiableList(domainEvents);
69+
}
70+
71+
}

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

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)