Skip to content

Commit b04f28d

Browse files
author
EmmanuelDuru
committed
TTL processing
1 parent d57ff55 commit b04f28d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

elasticsearch-mapping/src/main/java/org/elasticsearch/mapping/FieldsMappingBuilder.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,19 @@ public String getIdValue (Object obj) throws IntrospectionException, IllegalAcce
492492
return value;
493493
}
494494

495+
public String getTimeStamp (Class<?> clazz) throws IntrospectionException {
496+
List<Indexable> indexables = getIndexables(clazz);
497+
for (Indexable indexable : indexables) {
498+
TimeStamp ts = indexable.getAnnotation(TimeStamp.class);
499+
if (ts != null) {
500+
return indexable.getName();
501+
}
502+
}
503+
504+
if (clazz.getSuperclass() != null && clazz.getSuperclass() != Object.class) {
505+
return getTimeStamp(clazz.getSuperclass());
506+
}
507+
508+
return null;
509+
}
495510
}

0 commit comments

Comments
 (0)