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

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

There is a newer version: 5.6.15.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 org.hibernate.FetchNotFoundException;

/**
 * Possible actions when the database contains a non-null fk with no
 * matching target. This also implies that there are no physical
 * foreign-key constraints on the database.
 *
 * As an example, consider a typical Customer/Order model.  These actions apply
 * when a non-null `orders.customer_fk` value does not have a corresponding value
 * in `customers.id`.
 *
 * Generally this will occur in 2 scenarios:
    *
  • the associated data has been deleted
  • *
  • the model uses special "magic" values to indicate null
  • *
* * @author Steve Ebersole * @author Emmanuel Bernard */ public enum NotFoundAction { /** * Throw an exception when the association is not found (default and recommended). * * @see FetchNotFoundException */ EXCEPTION, /** * Ignore the association when not found in database. Effectively treats the * association as null, despite the non-null foreign-key value. */ IGNORE }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy