Package cz.cvut.kbss.jopa.sessions
Class ManagedInstanceBuilder
java.lang.Object
cz.cvut.kbss.jopa.sessions.ManagedInstanceBuilder
Builds instances of entity types.
This builder expects the original's class has a public no-arg constructor. Furthermore, if the configuration
specifies that the result will be registered in a persistence context, the instance built is not the base Java type
of the original, but rather the AbstractIdentifiableType.getInstantiableJavaType()
result, which is a generated
subclass whose instances can be attached to the persistence context.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected static Constructor<?>
getDeclaredConstructorFor
(Class<?> javaClass, Class<?>[] args) Return the declared constructor for the specified class.protected static void
logConstructorAccessException
(Constructor<?> constructor, Exception e)
-
Field Details
-
builder
-
uow
-
-
Method Details
-
getDeclaredConstructorFor
Return the declared constructor for the specified class. If the constructor is not accessible, it is set accessible. If there is no constructor corresponding to the specified argument list, null is returned.- Parameters:
javaClass
- The class of the constructor.args
- An Array of classes, which should take the constructor as parameters.- Returns:
- Constructor
- Throws:
SecurityException
- If the security check denies access to the constructor.
-
logConstructorAccessException
-