|
| 1 | +package org.springframework.data.elasticsearch.entities; |
| 2 | + |
| 3 | +import java.util.Date; |
| 4 | +import java.util.List; |
| 5 | + |
| 6 | +import org.springframework.data.annotation.Id; |
| 7 | +import org.springframework.data.elasticsearch.annotations.*; |
| 8 | + |
| 9 | +/** |
| 10 | + * Created by mohsinhusen on 10/04/15. |
| 11 | + */ |
| 12 | +@Document(indexName = "operations", type = "operation") |
| 13 | +public class OperationDocument { |
| 14 | + |
| 15 | + @Id |
| 16 | + private Long id; |
| 17 | + |
| 18 | + @Field( |
| 19 | + type = FieldType.String, |
| 20 | + index = FieldIndex.analyzed, |
| 21 | + searchAnalyzer = "standard", |
| 22 | + indexAnalyzer = "standard", |
| 23 | + store = true |
| 24 | + ) |
| 25 | + private String operationName; |
| 26 | + |
| 27 | + @Field( |
| 28 | + type = FieldType.Date, |
| 29 | + index = FieldIndex.not_analyzed, |
| 30 | + store = true, |
| 31 | + format = DateFormat.custom, pattern = "dd.MM.yyyy hh:mm" |
| 32 | + ) |
| 33 | + private Date dateUp; |
| 34 | + |
| 35 | + @Field( |
| 36 | + type = FieldType.String, |
| 37 | + index = FieldIndex.not_analyzed, |
| 38 | + store = false |
| 39 | + ) |
| 40 | + private String someTransientData; |
| 41 | + |
| 42 | + @Field(type = FieldType.Nested) |
| 43 | + private List<Sector> sectors; |
| 44 | + |
| 45 | + public Long getId() { |
| 46 | + return id; |
| 47 | + } |
| 48 | + |
| 49 | + public void setId(Long id) { |
| 50 | + this.id = id; |
| 51 | + } |
| 52 | + |
| 53 | + public String getOperationName() { |
| 54 | + return operationName; |
| 55 | + } |
| 56 | + |
| 57 | + public void setOperationName(String operationName) { |
| 58 | + this.operationName = operationName; |
| 59 | + } |
| 60 | + |
| 61 | + public Date getDateUp() { |
| 62 | + return dateUp; |
| 63 | + } |
| 64 | + |
| 65 | + public void setDateUp(Date dateUp) { |
| 66 | + this.dateUp = dateUp; |
| 67 | + } |
| 68 | + |
| 69 | + public String getSomeTransientData() { |
| 70 | + return someTransientData; |
| 71 | + } |
| 72 | + |
| 73 | + public void setSomeTransientData(String someTransientData) { |
| 74 | + this.someTransientData = someTransientData; |
| 75 | + } |
| 76 | + |
| 77 | + public List<Sector> getSectors() { |
| 78 | + return sectors; |
| 79 | + } |
| 80 | + |
| 81 | + public void setSectors(List<Sector> sectors) { |
| 82 | + this.sectors = sectors; |
| 83 | + } |
| 84 | +} |
| 85 | + |
0 commit comments