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

io.ebeaninternal.server.deploy.PropertyForeignKey Maven / Gradle / Ivy

There is a newer version: 15.8.0
Show newest version
package io.ebeaninternal.server.deploy;

import io.ebean.annotation.ConstraintMode;
import io.ebean.annotation.DbForeignKey;

public final class PropertyForeignKey {

  private final boolean noIndex;
  private final boolean noConstraint;
  private final ConstraintMode onDelete;
  private final ConstraintMode onUpdate;

  /**
   * Construct for "No Constraint".
   */
  public PropertyForeignKey() {
    this.noConstraint = true;
    this.noIndex = false;
    this.onDelete = ConstraintMode.RESTRICT;
    this.onUpdate = ConstraintMode.RESTRICT;
  }

  /**
   * Construct for the mapping annotation.
   */
  public PropertyForeignKey(DbForeignKey dbForeignKey) {
    this.noIndex = dbForeignKey.noIndex();
    this.noConstraint = dbForeignKey.noConstraint();
    this.onDelete = dbForeignKey.onDelete();
    this.onUpdate = dbForeignKey.onUpdate();
  }

  public boolean isNoIndex() {
    return noIndex;
  }

  public boolean isNoConstraint() {
    return noConstraint;
  }

  public ConstraintMode getOnDelete() {
    return onDelete;
  }

  public ConstraintMode getOnUpdate() {
    return onUpdate;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy