org.babyfish.jimmer.sql.cache.CacheFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.sql.cache;
import org.babyfish.jimmer.meta.ImmutableProp;
import org.babyfish.jimmer.meta.ImmutableType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public interface CacheFactory {
/**
* Create cache for an entity type.
*
* If you don't want all entity types to support object caching,
* you can check the parameters and return null in some cases
*
* @see org.babyfish.jimmer.sql.cache.chain.ChainCacheBuilder
* @param type The entity type
* @return Cache object or null
*/
default Cache, ?> createObjectCache(ImmutableType type) {
return null;
}
/**
* Create cache for one-to-one/many-to-one association property.
*
* If you don't want all one-to-one/many-to-one associations
* to support object caching, you can check the parameters and
* return null in some cases
*
* @see org.babyfish.jimmer.sql.cache.chain.ChainCacheBuilder
* @param prop The one-to-one/many-to-one association property
* @return Cache object or null
*/
default Cache, ?> createAssociatedIdCache(ImmutableProp prop) {
return null;
}
/**
* Create cache for one-to-many/many-to-many association.
*
* If you don't want all one-to-many/many-to-many associations
* to support object caching, you can check the parameters and
* return null in some cases
*
* @see org.babyfish.jimmer.sql.cache.chain.ChainCacheBuilder
* @param prop The one-to-many/many-to-many association property
* @return Cache object or null
*/
default Cache, List>> createAssociatedIdListCache(ImmutableProp prop) {
return null;
}
/**
* Create cache for complex calculated property.
*
* If you don't want all complex calculated properties
* to support object caching, you can check the parameters and
* return null in some cases
*
* @see org.babyfish.jimmer.sql.cache.chain.ChainCacheBuilder
* @param prop The complex calculated property
* @return Cache object or null
*/
default Cache, ?> createResolverCache(ImmutableProp prop) {
return null;
}
}