Skip to content

Package: Metamodel

Metamodel

Coverage

1: /**
2: * Copyright (C) 2020 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 java.net.URI;
18: import java.util.Set;
19:
20: /**
21: * Provides access to the metamodel of persistent entities in the persistence
22: * unit.
23: */
24: public interface Metamodel {
25: /**
26: * Return the metamodel entity type representing the entity.
27: *
28: * @param cls the type of the represented entity
29: * @return the metamodel entity type
30: * @throws IllegalArgumentException if not an entity
31: */
32: <X> EntityType<X> entity(Class<X> cls);
33:
34: /**
35: * Return the metamodel managed types.
36: *
37: * @return the metamodel managed types
38: */
39: Set<ManagedType<?>> getManagedTypes();
40:
41: /**
42: * Return the metamodel entity types.
43: *
44: * @return the metamodel entity types
45: */
46: Set<EntityType<?>> getEntities();
47:
48: /**
49: * Get the set of classes that contain inferred attributes. These classes
50: * are handled specially since inferred attributes can be influenced by
51: * changes to any other attributes in any other entity.
52: *
53: * @return The set of classes with inferred attributes.
54: */
55: Set<Class<?>> getInferredClasses();
56:
57: /**
58: * Gets a set of URIs that should be added to module extraction signature.
59: * <p>
60: * The returned collection is not modifiable.
61: *
62: * @return A set of URIs
63: */
64: Set<URI> getModuleExtractionExtraSignature();
65:
66: /**
67: * Adds the specified URI to the module extraction signature.
68: * <p>
69: * Note that a module including the specified URI will be created when a new
70: * resource level transaction is started. When that will be is
71: * implementation dependent. However it must be guaranteed that all
72: * subsequent connections provided by OntoDriver will include the URI in
73: * extracted modules.
74: *
75: * @param uri The URI to add
76: * @throws NullPointerException If {@code uri} is {@code null}
77: */
78: void addUriToModuleExtractionSignature(URI uri);
79: }