Skip to contentPackage: Enumerated
Enumerated
Coverage
1: /**
2: * Copyright (C) 2023 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.model.annotations;
16:
17: import java.lang.annotation.*;
18:
19: /**
20: * Specifies that a persistent property or field should be persisted as an enumerated type.
21: * <p>
22: * If the enumerated type is not specified or the Enumerated annotation is not used, the EnumType value is assumed to be
23: * {@code STRING}.
24: */
25: @Documented
26: @Retention(RetentionPolicy.RUNTIME)
27: @Target({ElementType.FIELD,ElementType.METHOD})
28: public @interface Enumerated {
29:
30: /**
31: * (Optional) The type used in mapping an enum type.
32: *
33: * @return Enum mapping type
34: */
35: EnumType value() default EnumType.STRING;
36: }