001package io.ebean.annotation;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * A non-JPA standard alternative to using <code>@Column(length)</code>.
010 * <p>
011 * We would typically set the length of a varchar column using <code>@Column(length)</code>
012 * or via javax validation <code>@Size(max)</code> annotations.
013 * </p>
014 * <p>
015 * In Kotlin we tend NOT to use the <code>@Size(max)</code> annotation as it has more
016 * targets (including parameter) and so when beans are written in Kotlin constructor form
017 * the <code>@Size</code> is not read as a mapping.
018 * </p>
019 * <p>
020 * So it is generally not ideal to use this non-standard JPA annotation but some may prefer
021 * it style wise - especially with Kotlin.
022 * </p>
023 */
024@Retention(RetentionPolicy.RUNTIME)
025@Target(ElementType.FIELD)
026public @interface Length {
027
028  int value();
029}