Interface EntityInstantiator

All Known Implementing Classes:
ReflectionEntityInstantiator

public interface EntityInstantiator
Interface to be implemented to override entity instances creation. This is mainly designed for SDN, Spring data commons having some infrastructure code to do fancy object instantiation using persistence constructors and ASM low level bytecode generation.
  • Method Details

    • createInstance

      <T> T createInstance(Class<T> clazz, Map<String,Object> propertyValues)
      Creates an instance of a given class. Ignores the provided propertyValues for compatibility reasons.
      Type Parameters:
      T - Type to create
      Parameters:
      clazz - The class to materialize.
      propertyValues - Properties of the object (unused!)
      Returns:
      The created instance.
    • createInstanceWithConstructorArgs

      <T> T createInstanceWithConstructorArgs(Class<T> clazz, Map<String,Object> propertyValues)
      Creates an instance of a given class and populates the constructor fields, if needed/possible.
      Type Parameters:
      T - Type to create
      Parameters:
      clazz - The class to maerialize.
      propertyValues - Properties of the object (needed for constructors with args)
      Returns:
      New instance.