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
Contextdeclared, use it for all its fields - If a field has
Contextdeclared, and it is an object property referencing another entity, propagate the context to that entity - If a class does not have
Contextdeclared, use context propagated to its from referencing class (if available) - If a field has
Contextand is not an object property referencing another entity, use the context for the value
-
Method Summary
Modifier and TypeMethodDescription<T> DescriptorcreateDescriptor(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
-