Skip to content

Instantly share code, notes, and snippets.

@cy6erGn0m
Created February 5, 2016 15:59
Show Gist options
  • Save cy6erGn0m/b2d3477d2e053a41e51a to your computer and use it in GitHub Desktop.
Save cy6erGn0m/b2d3477d2e053a41e51a to your computer and use it in GitHub Desktop.
Kotlin ehcache example
val cacheManager = CacheManagerBuilder.newCacheManagerBuilder()
.with(CacheManagerPersistenceConfiguration(storagePath))
.withCache("kweetsCache",
CacheConfigurationBuilder.newCacheConfigurationBuilder<Int, Kweet>()
.withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder()
.heap(1000, EntryUnit.ENTRIES)
.offheap(10, MemoryUnit.MB)
.disk(100, MemoryUnit.MB, true)
)
.buildConfig(Int::class.javaObjectType, Kweet::class.java))
.build(true)
@vick-ram
Copy link

vick-ram commented May 2, 2024

Not necessarily Int::class.javaObjectType but your Entity's primary key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment