|
| 1 | +/* |
| 2 | + * Copyright 2013 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 | +package org.springframework.data.elasticsearch.entities; |
| 17 | + |
| 18 | + |
| 19 | +import org.springframework.data.annotation.Id; |
| 20 | +import org.springframework.data.elasticsearch.annotations.Document; |
| 21 | +import org.springframework.data.elasticsearch.annotations.Field; |
| 22 | +import org.springframework.data.elasticsearch.annotations.FieldType; |
| 23 | + |
| 24 | +import java.util.List; |
| 25 | + |
| 26 | +/** |
| 27 | + * @author Rizwan Idrees |
| 28 | + * @author Mohsin Husen |
| 29 | + * @author Artur Konczak |
| 30 | + */ |
| 31 | + |
| 32 | +@Document( indexName = "person" , type = "user", indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1") |
| 33 | +public class Person { |
| 34 | + |
| 35 | + @Id |
| 36 | + private String id; |
| 37 | + |
| 38 | + private String name; |
| 39 | + |
| 40 | + @Field( type = FieldType.Nested) |
| 41 | + private List<Car> car; |
| 42 | + |
| 43 | + public String getId() { |
| 44 | + return id; |
| 45 | + } |
| 46 | + |
| 47 | + public void setId(String id) { |
| 48 | + this.id = id; |
| 49 | + } |
| 50 | + |
| 51 | + public String getName() { |
| 52 | + return name; |
| 53 | + } |
| 54 | + |
| 55 | + public void setName(String name) { |
| 56 | + this.name = name; |
| 57 | + } |
| 58 | + |
| 59 | + public List<Car> getCar() { |
| 60 | + return car; |
| 61 | + } |
| 62 | + |
| 63 | + public void setCar(List<Car> car) { |
| 64 | + this.car = car; |
| 65 | + } |
| 66 | +} |
0 commit comments