Skip to content

Commit 8d5c40c

Browse files
author
mpv1989
committed
Remove Key, Param, DBEntity, DBCollectionEntity
1 parent e43356f commit 8d5c40c

File tree

9 files changed

+67
-286
lines changed

9 files changed

+67
-286
lines changed

src/main/java/com/arangodb/springframework/annotation/Key.java

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

src/main/java/com/arangodb/springframework/annotation/Param.java

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

src/main/java/com/arangodb/springframework/core/convert/DBCollectionEntity.java

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

src/main/java/com/arangodb/springframework/core/convert/DBDocumentEntity.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
* @author Mark Vollmary
2828
*
2929
*/
30-
@SuppressWarnings("deprecation")
31-
public class DBDocumentEntity extends HashMap<String, Object> implements DBEntity {
30+
public class DBDocumentEntity extends HashMap<String, Object> {
3231

3332
private static final long serialVersionUID = -7251842887063588024L;
3433

@@ -40,10 +39,4 @@ public DBDocumentEntity(final Map<? extends String, ? extends Object> m) {
4039
super(m);
4140
}
4241

43-
@Deprecated
44-
@Override
45-
public boolean add(final Object value) {
46-
throw new UnsupportedOperationException();
47-
}
48-
4942
}

src/main/java/com/arangodb/springframework/core/convert/DBEntity.java

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
1-
/*
2-
* DISCLAIMER
3-
*
4-
* Copyright 2017 ArangoDB GmbH, Cologne, Germany
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*
18-
* Copyright holder is ArangoDB GmbH, Cologne, Germany
19-
*/
20-
21-
package com.arangodb.springframework.core.mapping;
22-
23-
import java.util.Optional;
24-
25-
import org.springframework.data.mapping.PersistentProperty;
26-
27-
import com.arangodb.springframework.annotation.From;
28-
import com.arangodb.springframework.annotation.FulltextIndexed;
29-
import com.arangodb.springframework.annotation.GeoIndexed;
30-
import com.arangodb.springframework.annotation.HashIndexed;
31-
import com.arangodb.springframework.annotation.PersistentIndexed;
32-
import com.arangodb.springframework.annotation.Ref;
33-
import com.arangodb.springframework.annotation.Relations;
34-
import com.arangodb.springframework.annotation.SkiplistIndexed;
35-
import com.arangodb.springframework.annotation.To;
36-
37-
/**
38-
* @author Mark Vollmary
39-
*
40-
*/
41-
public interface ArangoPersistentProperty extends PersistentProperty<ArangoPersistentProperty> {
42-
43-
String getFieldName();
44-
45-
boolean isKeyProperty();
46-
47-
boolean isRevProperty();
48-
49-
Optional<Ref> getRef();
50-
51-
Optional<Relations> getRelations();
52-
53-
Optional<From> getFrom();
54-
55-
Optional<To> getTo();
56-
57-
Optional<HashIndexed> getHashIndexed();
58-
59-
Optional<SkiplistIndexed> getSkiplistIndexed();
60-
61-
Optional<PersistentIndexed> getPersistentIndexed();
62-
63-
Optional<GeoIndexed> getGeoIndexed();
64-
65-
Optional<FulltextIndexed> getFulltextIndexed();
66-
67-
}
1+
/*
2+
* DISCLAIMER
3+
*
4+
* Copyright 2017 ArangoDB GmbH, Cologne, Germany
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
*/
20+
21+
package com.arangodb.springframework.core.mapping;
22+
23+
import java.util.Optional;
24+
25+
import org.springframework.data.mapping.PersistentProperty;
26+
27+
import com.arangodb.springframework.annotation.From;
28+
import com.arangodb.springframework.annotation.FulltextIndexed;
29+
import com.arangodb.springframework.annotation.GeoIndexed;
30+
import com.arangodb.springframework.annotation.HashIndexed;
31+
import com.arangodb.springframework.annotation.PersistentIndexed;
32+
import com.arangodb.springframework.annotation.Ref;
33+
import com.arangodb.springframework.annotation.Relations;
34+
import com.arangodb.springframework.annotation.SkiplistIndexed;
35+
import com.arangodb.springframework.annotation.To;
36+
37+
/**
38+
* @author Mark Vollmary
39+
*
40+
*/
41+
public interface ArangoPersistentProperty extends PersistentProperty<ArangoPersistentProperty> {
42+
43+
String getFieldName();
44+
45+
boolean isRevProperty();
46+
47+
Optional<Ref> getRef();
48+
49+
Optional<Relations> getRelations();
50+
51+
Optional<From> getFrom();
52+
53+
Optional<To> getTo();
54+
55+
Optional<HashIndexed> getHashIndexed();
56+
57+
Optional<SkiplistIndexed> getSkiplistIndexed();
58+
59+
Optional<PersistentIndexed> getPersistentIndexed();
60+
61+
Optional<GeoIndexed> getGeoIndexed();
62+
63+
Optional<FulltextIndexed> getFulltextIndexed();
64+
65+
}

src/main/java/com/arangodb/springframework/core/mapping/DefaultArangoPersistentEntity.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,6 @@ public void addPersistentProperty(final ArangoPersistentProperty property) {
194194
property.getFulltextIndexed().ifPresent(i -> fulltextIndexedProperties.add(property));
195195
}
196196

197-
@Override
198-
protected ArangoPersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(
199-
final ArangoPersistentProperty property) {
200-
final ArangoPersistentProperty idPropertyOrNull = super.returnPropertyIfBetterIdPropertyCandidateOrNull(
201-
property);
202-
if (idPropertyOrNull == null && property.isKeyProperty()) {
203-
return property;
204-
}
205-
return idPropertyOrNull;
206-
}
207-
208197
@Override
209198
public Optional<ArangoPersistentProperty> getRevProperty() {
210199
return Optional.ofNullable(revProperty);

src/main/java/com/arangodb/springframework/core/mapping/DefaultArangoPersistentProperty.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import com.arangodb.springframework.annotation.FulltextIndexed;
3737
import com.arangodb.springframework.annotation.GeoIndexed;
3838
import com.arangodb.springframework.annotation.HashIndexed;
39-
import com.arangodb.springframework.annotation.Key;
4039
import com.arangodb.springframework.annotation.PersistentIndexed;
4140
import com.arangodb.springframework.annotation.Ref;
4241
import com.arangodb.springframework.annotation.Relations;
@@ -48,7 +47,6 @@
4847
* @author Mark Vollmary
4948
*
5049
*/
51-
@SuppressWarnings("deprecation")
5250
public class DefaultArangoPersistentProperty extends AnnotationBasedPersistentProperty<ArangoPersistentProperty>
5351
implements ArangoPersistentProperty {
5452

@@ -67,11 +65,6 @@ protected Association<ArangoPersistentProperty> createAssociation() {
6765
return new Association<>(this, null);
6866
}
6967

70-
@Override
71-
public boolean isKeyProperty() {
72-
return findAnnotation(Key.class) != null;
73-
}
74-
7568
@Override
7669
public boolean isRevProperty() {
7770
return findAnnotation(Rev.class) != null;
@@ -100,7 +93,7 @@ public Optional<To> getTo() {
10093
@Override
10194
public String getFieldName() {
10295
final String fieldName;
103-
if (isIdProperty() || isKeyProperty()) {
96+
if (isIdProperty()) {
10497
fieldName = "_key";
10598
} else if (isRevProperty()) {
10699
fieldName = "_rev";

0 commit comments

Comments
 (0)