1
+ /**
2
+ * Copyright © 2013 spring-data-dynamodb (https://github.com/derjust/spring-data-dynamodb)
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
+ package org .socialsignin .spring .data .dynamodb .repository .query .nested ;
17
+
18
+ import com .amazonaws .services .dynamodbv2 .datamodeling .DynamoDBHashKey ;
19
+ import com .amazonaws .services .dynamodbv2 .datamodeling .DynamoDBRangeKey ;
20
+ import com .amazonaws .services .dynamodbv2 .datamodeling .DynamoDBTable ;
21
+ import org .springframework .data .annotation .Id ;
22
+
23
+ @ DynamoDBTable (tableName = "Person" )
24
+ public class Person {
25
+
26
+ @ Id
27
+ private PersonId personId ;
28
+
29
+ private String phone ;
30
+ private Address address ;
31
+
32
+ @ DynamoDBHashKey
33
+ public String getName () {
34
+ return personId != null ? personId .getName () : null ;
35
+ }
36
+
37
+ @ DynamoDBRangeKey
38
+ public String getArea () {
39
+ return personId != null ? personId .getArea () : null ;
40
+ }
41
+ public Address getAddress () {
42
+ return address ;
43
+ }
44
+ public String getPhone () {
45
+ return phone ;
46
+ }
47
+ public void setPhone (String phone ) {
48
+ this .phone = phone ;
49
+ }
50
+ public void setName (String name ) {
51
+ if (personId == null ) {
52
+ personId = new PersonId ();
53
+ }
54
+ this .personId .setName (name );
55
+ }
56
+ public void setArea (String area ) {
57
+ if (personId == null ) {
58
+ personId = new PersonId ();
59
+ }
60
+ this .personId .setArea (area );
61
+ }
62
+ public void setAddress (Address address ) {
63
+ this .address = address ;
64
+ }
65
+ }
0 commit comments