Revision 46532
Added by Claudio Atzori about 7 years ago
Metadata.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import com.google.common.collect.Lists; |
12 | 12 |
import com.google.common.collect.Maps; |
13 |
import org.springframework.data.mongodb.core.index.CompoundIndex; |
|
14 |
import org.springframework.data.mongodb.core.index.CompoundIndexes; |
|
13 | 15 |
import org.springframework.data.mongodb.core.index.Indexed; |
14 | 16 |
import org.springframework.data.mongodb.core.mapping.Document; |
15 | 17 |
|
16 | 18 |
@Document |
19 |
@CompoundIndexes({ |
|
20 |
@CompoundIndex(name = "fli_idx", def = "{'format': 1, 'layout': 1, 'interpretation': 1}") |
|
21 |
}) |
|
17 | 22 |
public class Metadata { |
18 | 23 |
|
19 | 24 |
@Indexed(unique = true) |
... | ... | |
64 | 69 |
* @return the expiring days |
65 | 70 |
*/ |
66 | 71 |
private long getExpiringDays(final ReadLock info) { |
67 |
final Date lastRead = info.getLastUpdateDate();
|
|
68 |
final LocalDate readDate = lastRead.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
72 |
final Long lastRead = info.getLastUpdate();
|
|
73 |
final LocalDate readDate = new Date(lastRead).toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
69 | 74 |
return Duration.between(LocalDate.now().atTime(0, 0), readDate.atTime(0, 0)).toDays(); |
70 | 75 |
} |
71 | 76 |
|
Also available in: Unified diff
using long to store dates, cleanup