Skip to content

Package: Type

Type

Coverage

1: /**
2: * Copyright (C) 2016 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.metamodel;
16:
17: import cz.cvut.kbss.jopa.UnusedJPA;
18:
19: /**
20: * Instances of the type Type represent persistent object or attribute types.
21: *
22: * @param <X>
23: * The type of the represented object or attribute
24: */
25: public interface Type<X> {
26:         public static enum PersistenceType {
27:                 ENTITY,
28:
29:                 @Deprecated
30:                 @UnusedJPA
31:                 /**
32:                  * Embeddable classes are logical groupings of state in Java that is "flattened" in RDB. Such mapping seems useless, or at lest of low priority, in ontologies.
33:                  */
34:                 EMBEDDABLE,
35:
36:                 @Deprecated
37:                 @UnusedJPA
38:                 /**
39:                  * Mapped superclasses help building entities with common state definition. They are not entities. For ontologies this requirement seems useless as creating hierarchies is a natural operation.
40:                  */
41:                 MAPPED_SUPERCLASS,
42:
43:                 BASIC,
44:         }
45:
46:         /**
47:          * Return the persistence type.
48:          *
49:          * @return persistence type
50:          */
51:         PersistenceType getPersistenceType();
52:
53:         /**
54:          * Return the represented Java type.
55:          *
56:          * @return Java type
57:          */
58:         Class<X> getJavaType();
59: }