Package cz.cvut.kbss.jopa.model
Interface EntityDescriptorFactory
- All Known Implementing Classes:
CachingEntityDescriptorFactory
,DefaultEntityDescriptorFactory
public interface EntityDescriptorFactory
Creates entity descriptors based on metamodel information.
The logic is based on the following rules:
- If a class has
Context
declared, use it for all its fields - If a field has
Context
declared, and it is an object property referencing another entity, propagate the context to that entity - If a class does not have
Context
declared, use context propagated to its from referencing class (if available) - If a field has
Context
and is not an object property referencing another entity, use the context for the value
-
Method Summary
Modifier and TypeMethodDescription<T> Descriptor
createDescriptor
(Class<T> cls) Creates a descriptor for the specified entity class.
-
Method Details
-
createDescriptor
Creates a descriptor for the specified entity class.- Type Parameters:
T
- Entity type- Parameters:
cls
- Entity class to generate descriptor for- Returns:
- Entity descriptor
- Throws:
IllegalArgumentException
- If the specified class is not an entity class
-