Skip to content

Commit 6f3a02c

Browse files
committed
format code.
1 parent 95e6adc commit 6f3a02c

42 files changed

Lines changed: 2659 additions & 2587 deletions

Some content is hidden

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @author Xuegui Yuan
2929
*/
3030
@Retention(RetentionPolicy.RUNTIME)
31-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
31+
@Target( {ElementType.METHOD, ElementType.ANNOTATION_TYPE})
3232
@Documented
3333
public @interface Modifying {
3434
}

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@
2929
* @author Xuegui Yuan
3030
*/
3131
@Retention(RetentionPolicy.RUNTIME)
32-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
32+
@Target( {ElementType.METHOD, ElementType.ANNOTATION_TYPE})
3333
@QueryAnnotation
3434
@Documented
3535
public @interface Procedure {
3636

37-
/**
38-
* The name of the procedure in the database, defaults to {@code ""}. Short form for {@link #procedureName()}.
39-
*/
40-
String value() default "";
37+
/**
38+
* The name of the procedure in the database, defaults to {@code ""}. Short form for {@link #procedureName()}.
39+
*/
40+
String value() default "";
4141

42-
/**
43-
* The name of the procedure in the database, defaults to {@code ""}.
44-
*/
45-
String procedureName() default "";
42+
/**
43+
* The name of the procedure in the database, defaults to {@code ""}.
44+
*/
45+
String procedureName() default "";
4646

47-
/**
48-
* The name of the procedure in the EntityManager - defaults to {@code ""}.
49-
*/
50-
String name() default "";
47+
/**
48+
* The name of the procedure in the EntityManager - defaults to {@code ""}.
49+
*/
50+
String name() default "";
5151

52-
/**
53-
* The name of the outputParameter, defaults to {@code ""}.
54-
*/
55-
String outputParameterName() default "";
52+
/**
53+
* The name of the outputParameter, defaults to {@code ""}.
54+
*/
55+
String outputParameterName() default "";
5656
}

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@
2929
* @author Xuegui Yuan
3030
*/
3131
@Retention(RetentionPolicy.RUNTIME)
32-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
32+
@Target( {ElementType.METHOD, ElementType.ANNOTATION_TYPE})
3333
@QueryAnnotation
3434
@Documented
3535
public @interface Query {
3636

37-
/**
38-
* Defines the Ebean query to be executed when the annotated method is called.
39-
*/
40-
String value() default "";
37+
/**
38+
* Defines the Ebean query to be executed when the annotated method is called.
39+
*/
40+
String value() default "";
4141

42-
/**
43-
* Configures whether the given query is a SqlQuery. Defaults to {@literal false}.
44-
*/
45-
boolean nativeQuery() default false;
42+
/**
43+
* Configures whether the given query is a SqlQuery. Defaults to {@literal false}.
44+
*/
45+
boolean nativeQuery() default false;
4646

47-
/**
48-
* The named query to be used. If not defined, a {@link javax.persistence.NamedQuery} with name of
49-
* {@code $ domainClass}.${queryMethodName}} will be used.
50-
*/
51-
String name() default "";
47+
/**
48+
* The named query to be used. If not defined, a {@link javax.persistence.NamedQuery} with name of
49+
* {@code $ domainClass}.${queryMethodName}} will be used.
50+
*/
51+
String name() default "";
5252

53-
/**
54-
* Parse the string to return a FetchPath,
55-
* format like (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a
56-
* path containing "g" and the root path contains "a","b","c" and "f".
57-
*/
58-
String fetchPath() default "";
53+
/**
54+
* Parse the string to return a FetchPath,
55+
* format like (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a
56+
* path containing "g" and the root path contains "a","b","c" and "f".
57+
*/
58+
String fetchPath() default "";
5959
}

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

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.data.ebean.domain;
1718

1819
import io.ebean.annotation.CreatedTimestamp;
@@ -33,57 +34,57 @@
3334
public abstract class AbstractAuditableEntity extends AbstractEntity
3435
implements Auditable<String, Long, LocalDateTime> {
3536

36-
private static final long serialVersionUID = 141481953116476081L;
37+
private static final long serialVersionUID = 141481953116476081L;
3738

38-
@WhoCreated
39-
String createdBy;
39+
@WhoCreated
40+
String createdBy;
4041

41-
@CreatedTimestamp
42-
LocalDateTime createdDate;
42+
@CreatedTimestamp
43+
LocalDateTime createdDate;
4344

44-
@WhoModified
45-
String lastModifiedBy;
45+
@WhoModified
46+
String lastModifiedBy;
4647

47-
@UpdatedTimestamp
48-
LocalDateTime lastModifiedDate;
48+
@UpdatedTimestamp
49+
LocalDateTime lastModifiedDate;
4950

50-
@Override
51-
public Optional<String> getCreatedBy() {
52-
return Optional.ofNullable(createdBy);
53-
}
51+
@Override
52+
public Optional<String> getCreatedBy() {
53+
return Optional.ofNullable(createdBy);
54+
}
5455

55-
@Override
56-
public void setCreatedBy(String createdBy) {
57-
this.createdBy = createdBy;
58-
}
56+
@Override
57+
public void setCreatedBy(String createdBy) {
58+
this.createdBy = createdBy;
59+
}
5960

60-
@Override
61-
public Optional<LocalDateTime> getCreatedDate() {
62-
return Optional.ofNullable(createdDate);
63-
}
61+
@Override
62+
public Optional<LocalDateTime> getCreatedDate() {
63+
return Optional.ofNullable(createdDate);
64+
}
6465

65-
@Override
66-
public void setCreatedDate(LocalDateTime createdDate) {
67-
this.createdDate = createdDate;
68-
}
66+
@Override
67+
public void setCreatedDate(LocalDateTime createdDate) {
68+
this.createdDate = createdDate;
69+
}
6970

70-
@Override
71-
public Optional<String> getLastModifiedBy() {
72-
return Optional.ofNullable(lastModifiedBy);
73-
}
71+
@Override
72+
public Optional<String> getLastModifiedBy() {
73+
return Optional.ofNullable(lastModifiedBy);
74+
}
7475

75-
@Override
76-
public void setLastModifiedBy(String lastModifiedBy) {
77-
this.lastModifiedBy = lastModifiedBy;
78-
}
76+
@Override
77+
public void setLastModifiedBy(String lastModifiedBy) {
78+
this.lastModifiedBy = lastModifiedBy;
79+
}
7980

80-
@Override
81-
public Optional<LocalDateTime> getLastModifiedDate() {
82-
return Optional.ofNullable(lastModifiedDate);
83-
}
81+
@Override
82+
public Optional<LocalDateTime> getLastModifiedDate() {
83+
return Optional.ofNullable(lastModifiedDate);
84+
}
8485

85-
@Override
86-
public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
87-
this.lastModifiedDate = lastModifiedDate;
88-
}
86+
@Override
87+
public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
88+
this.lastModifiedDate = lastModifiedDate;
89+
}
8990
}

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

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.data.ebean.domain;
1718

1819
import javax.persistence.Id;
@@ -30,75 +31,75 @@
3031
@MappedSuperclass
3132
public abstract class AbstractEntity implements Persistable<Long> {
3233

33-
private static final long serialVersionUID = -5554308939380869754L;
34+
private static final long serialVersionUID = -5554308939380869754L;
3435

35-
@Id
36-
protected Long id;
36+
@Id
37+
protected Long id;
3738

38-
/*
39-
* (non-Javadoc)
40-
*
41-
* @see java.lang.Object#hashCode()
42-
*/
43-
@Override
44-
public int hashCode() {
39+
/*
40+
* (non-Javadoc)
41+
*
42+
* @see java.lang.Object#hashCode()
43+
*/
44+
@Override
45+
public int hashCode() {
4546

46-
int hashCode = 17;
47+
int hashCode = 17;
4748

48-
hashCode += null == getId() ? 0 : getId().hashCode() * 31;
49+
hashCode += null == getId() ? 0 : getId().hashCode() * 31;
4950

50-
return hashCode;
51-
}
51+
return hashCode;
52+
}
5253

5354
@Override
54-
public Long getId() {
55-
return id;
56-
}
55+
public Long getId() {
56+
return id;
57+
}
58+
59+
/**
60+
* Sets the id of the entity.
61+
*
62+
* @param id the id to set
63+
*/
64+
public void setId(final Long id) {
65+
this.id = id;
66+
}
67+
68+
@Transient
69+
@Override
70+
public boolean isNew() {
71+
return null == getId();
72+
}
5773

58-
/**
59-
* Sets the id of the entity.
60-
*
61-
* @param id the id to set
62-
*/
63-
public void setId(final Long id) {
64-
this.id = id;
65-
}
74+
@Override
75+
public boolean equals(Object obj) {
6676

67-
@Transient
68-
@Override
69-
public boolean isNew() {
70-
return null == getId();
77+
if (null == obj) {
78+
return false;
7179
}
7280

73-
@Override
74-
public boolean equals(Object obj) {
75-
76-
if (null == obj) {
77-
return false;
78-
}
81+
if (this == obj) {
82+
return true;
83+
}
7984

80-
if (this == obj) {
81-
return true;
82-
}
85+
if (!getClass().equals(ClassUtils.getUserClass(obj))) {
86+
return false;
87+
}
8388

84-
if (!getClass().equals(ClassUtils.getUserClass(obj))) {
85-
return false;
86-
}
89+
AbstractEntity that = (AbstractEntity) obj;
8790

88-
AbstractEntity that = (AbstractEntity) obj;
91+
return null == this.getId() ? false : this.getId().equals(that.getId());
92+
}
8993

90-
return null == this.getId() ? false : this.getId().equals(that.getId());
91-
}
92-
93-
/*
94-
* (non-Javadoc)
95-
*
96-
* @see java.lang.Object#toString()
97-
*/
98-
@Override
99-
public String toString() {
100-
return String.format("Entity of type %s with id: %s", this.getClass().getName(), getId());
101-
}
94+
/*
95+
* (non-Javadoc)
96+
*
97+
* @see java.lang.Object#toString()
98+
*/
99+
@Override
100+
public String toString() {
101+
return String.format("Entity of type %s with id: %s", this.getClass().getName(), getId());
102+
}
102103

103104

104105
}
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
package org.springframework.data.ebean.domain;
22

3-
import java.lang.annotation.*;
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
48

59
/**
610
* Annotation placed on types that should be treated as the root of an aggregate.
711
*
812
* @author Xuegui Yuan
913
*/
1014
@Documented
11-
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
15+
@Target( {ElementType.TYPE, ElementType.ANNOTATION_TYPE})
1216
@Retention(RetentionPolicy.RUNTIME)
1317
public @interface AggregateRoot {
14-
/**
15-
* Get the String representation of the aggregate's type. Optional. This defaults to the simple name of the
16-
* annotated class.
17-
*/
18-
String type() default "";
18+
/**
19+
* Get the String representation of the aggregate's type. Optional. This defaults to the simple name of the
20+
* annotated class.
21+
*/
22+
String type() default "";
1923
}

0 commit comments

Comments
 (0)