DataCache
An adaptable cache that allows query-like operations.
class Person(val id: Int, val age: Int, val name: String)
val description = description(Person::id)
val cache = MapDataCache()
cache.register(description)
cache.put(Person(500, 24, "Test Dummy"))
val entry = cache.find<Person> { Person::id eq 500 }.single()
cache.find<Person>().update { it.copy(age = it.age + 1) }
cache.find<Person>().remove()
Cascading
DataCache supports cascading of entities linked by properties.
Annotation processor
DataDescriptions can be automatically generated with the annotation-processor module.
class User(
@Identity
@Link(Message::class, "userId")
val id: Int,
val name: String
)
class Message(
@Identity
val id: Int,
val userId: Int,
content: String
)
Note that there is currently an issue
with kapt relating to repeatable annotations. Because of that entities with
multiple @Link annotations on the same property will not generate those links.