Class EntityPropertyEditor<T>

  • Type Parameters:
    T - Entity class to create the property editor for
    All Implemented Interfaces:
    PropertyEditor

    public class EntityPropertyEditor<T>
    extends PropertyEditorSupport
    This class represents a generic property editor for entities. It provided an editor for all entities that implement the Identifiable interface. The property editor uses the WmId for String representation and WebManager session to retrieve the object from a given WmId. Therefore the Entity Manager is input parameter of the constructor of this property editor. The property editor uses generics to specify the entity type it should support. Add this property editor in your initBinder method. For example to define a property editor for the language:
    public void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { super.initBinder(request, binder); // Register basic property editors binder.registerCustomEditor(CustomEntity.class, new EntityPropertyEditor(entityManager)); }
    • Constructor Detail

      • EntityPropertyEditor

        public EntityPropertyEditor​(EntityManager entityManager)
        Constructor of the entity property editor
        Parameters:
        entityManager - Entity manager needed to convert from text to entity