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

com.avaje.ebean.annotation.EnumValue Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebean.annotation;

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

/**
 * Enables you to specify a value to use to persist for an enum value.
 * 
 * 
{@code
 *
 * public enum Status {
 *
 *   @EnumValue("N")
 *   NEW,
 * 
 *   @EnumValue("A")
 *   ACTIVE,
 * 
 *   @EnumValue("I")
 *   INACTIVE,
 * }
 * 
 * }
*

* This is an alternative to using the JPA standard approach or Ebean's * {@link DbEnumValue} annotation. *

*

* Note that if all the EnumValue values are parsable as Integers then Ebean * will persist and fetch them as integers - otherwise they will be persisted * and fetched as strings. *

*/ @Target({ ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface EnumValue { /** * Specify the value to persist for a specific enum value. *

* If all the values are parsable as Integers then Ebean will persist and * fetch them as integers rather than strings. *

*/ String value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy