Class TopiaEntityBinder<E extends TopiaEntity>

java.lang.Object
org.nuiton.util.beans.Binder<E,​E>
org.nuiton.topia.persistence.util.TopiaEntityBinder<E>
Type Parameters:
E - the type of entity
All Implemented Interfaces:
java.io.Serializable, Loador<E>

public class TopiaEntityBinder<E extends TopiaEntity>
extends org.nuiton.util.beans.Binder<E,​E>
implements Loador<E>
A Binder dedicated to TopiaEntity dealing with technical values. There is an internal sate empty to deal with default values of properties of an entity. Note: Should remove Loador contract soon.
Since:
2.3.0
Author:
tchemit <chemit@codelutin.com>
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.nuiton.util.beans.Binder

    org.nuiton.util.beans.Binder.BinderModel<S extends java.lang.Object,​T extends java.lang.Object>, org.nuiton.util.beans.Binder.CollectionStrategy
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected E empty  

    Fields inherited from class org.nuiton.util.beans.Binder

    model
  • Constructor Summary

    Constructors 
    Constructor Description
    TopiaEntityBinder()  
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.Object bind​(org.nuiton.util.beans.Binder binder, java.lang.Object read)  
    void load​(E source, E target, boolean tech, java.lang.String... propertyNames)
    Bind an entity to another.
    void setEmpty​(E empty)  

    Methods inherited from class org.nuiton.util.beans.Binder

    bindCollection, bindProperty, copy, copy, copyExcluding, diff, diff, diffExcluding, getAllPropertiesExclude, getCollectionValue, getModel, getProperties, getSourcePropertyGenericType, getSourcePropertyType, getSourceType, getTargetPropertyGenericType, getTargetPropertyType, getTargetType, injectProperties, injectProperties, obtainProperties, obtainProperties, obtainProperties, obtainSourceProperty, obtainTargetProperty, readProperty, setModel, transform

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.nuiton.topia.persistence.util.Loador

    getSourceType, obtainProperties
  • Field Details

  • Constructor Details

  • Method Details

    • setEmpty

      public void setEmpty​(E empty)
    • load

      public void load​(E source, E target, boolean tech, java.lang.String... propertyNames)
      Description copied from interface: Loador
      Bind an entity to another.
      Specified by:
      load in interface Loador<E extends TopiaEntity>
      Parameters:
      source - the source entity
      target - the destination entity
      tech - a flag to bind or not the technical values of the entity (says TopiaId, TopiaVersion and TopiaCreateDate).
      propertyNames - subset of properties to load
    • bind

      protected java.lang.Object bind​(org.nuiton.util.beans.Binder binder, java.lang.Object read) throws java.lang.IllegalAccessException, java.lang.InstantiationException
      Overrides:
      bind in class org.nuiton.util.beans.Binder<E extends TopiaEntity,​E extends TopiaEntity>
      Throws:
      java.lang.IllegalAccessException
      java.lang.InstantiationException