All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.annotations.NaturalIdCache Maven / Gradle / Ivy

There is a newer version: 6.6.2.Final
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Specifies that mappings from the natural id values of the annotated
 * entity to the corresponding entity id values should be cached in the
 * shared second-level cache. This allows Hibernate to sometimes avoid
 * round trip to the database when a cached entity is retrieved by its
 * natural id.
 * 

* This annotation is usually used in combination with {@link Cache}, * since a round trip may only be avoided if the entity itself is * also available in the cache. * * @author Eric Dalquist * @author Steve Ebersole * * @see NaturalId */ @Target(TYPE) @Retention(RUNTIME) public @interface NaturalIdCache { /** * Specifies an explicit cache region name. *

* By default, the region name is {@code EntityName##NaturalId}. */ String region() default ""; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy