Class AbstractBO<K extends java.io.Serializable,​T extends GeneralDTO<K>>

java.lang.Object
Type Parameters:
K - type of primary key
T - type of Transfer Object Implementation
All Implemented Interfaces:
java.io.Serializable, IBean, IPropertyChangeProvider, IIdObject<K>, IDirtyable, IGeneralBO<K>
Direct Known Subclasses:
AbstractMapBO

public abstract class AbstractBO<K extends java.io.Serializable,​T extends GeneralDTO<K>>
extends AbstractGeneralBO<K>
Abstract Implementation for Business Objects that require a Transfer Object.
Author:
ralph
See Also:
Serialized Form
  • Constructor Details

    • AbstractBO

      public AbstractBO()
      Constructor.
    • AbstractBO

      public AbstractBO​(T transferObject)
      Constructor.
      Parameters:
      transferObject - - the DTO to be used
  • Method Details

    • getTransferClass

      public java.lang.Class<T> getTransferClass()
      Returns the transferClass.
      Returns:
      the transferClass
    • getTransferObject

      @NoCopy public T getTransferObject()
      Returns the Transfer Object.
      Returns:
      transfer object
    • setTransferObject

      public void setTransferObject​(T transferObject)
      Sets the transfer object.
      Parameters:
      transferObject - the object to be set.
    • getId

      public K getId()
    • setId

      public void setId​(K id)
      Sets the id of this object.
      Specified by:
      setId in interface IGeneralBO<K extends java.io.Serializable>
      Specified by:
      setId in class AbstractGeneralBO<K extends java.io.Serializable>
      Parameters:
      id - id of object
    • getCreationDate

      public RsDate getCreationDate()
      Returns the creationDate.
      Returns:
      the creationDate
    • setCreationDate

      public void setCreationDate​(RsDate creationDate)
      Sets the creationDate.
      Parameters:
      creationDate - the creationDate to set
    • getChangeDate

      public RsDate getChangeDate()
      Returns the changeDate.
      Returns:
      the changeDate
    • setChangeDate

      public void setChangeDate​(RsDate changeDate)
      Sets the changeDate.
      Parameters:
      changeDate - the changeDate to set
    • getName

      public java.lang.String getName()
      Returns the name.
      Returns:
      the name
    • setName

      public void setName​(java.lang.String name)
      Sets the name.
      Parameters:
      name - the name to set
    • getBusinessObject

      protected <X extends java.io.Serializable,​ Y extends GeneralDTO<X>,​ Z extends IGeneralBO<X>> Z getBusinessObject​(Y dto)
      Fetches the BO from the DAO factory.
      Type Parameters:
      X - - key class of object
      Y - - DTO class of object
      Z - - BO class of object
      Parameters:
      dto - the DTO
      Returns:
      the BO
    • getTransferObject

      public <X extends java.io.Serializable,​ Y extends GeneralDTO<X>> Y getTransferObject​(AbstractBO<X,​Y> o)
      Returns the DTO from that BO (or null).
      Type Parameters:
      X - - key class of object
      Y - - DTO class of object
      Parameters:
      o - the BO
      Returns:
      the DTO underneath
    • getProperty

      public <X> X getProperty​(java.lang.String name)
      Returns the property of given name.
      Type Parameters:
      X - the type of the value
      Parameters:
      name - name of property
      Returns:
      value of property
      Since:
      1.2.9
    • setProperty

      public <X> void setProperty​(java.lang.String name, X value)
      Standard implementation of setter method.

      The method retrieves the old value via getProperty(String) and sets the new value through GeneralDTO.setProperty(String, Object). Afterwards it fires a PropertyChangeEvent for this property name.

      Type Parameters:
      X - the type of the value
      Parameters:
      name - name of DTO property and name to be used in PropertyChangeEvent
      value - value of property
      Since:
      1.2.9
    • setProperty

      public <X> void setProperty​(java.lang.String name, java.lang.String firePropertyName, X value)
      Standard implementation of setter method.

      The method retrieves the old value via getProperty(String) and sets the new value through GeneralDTO.setProperty(String, Object). Afterwards it fires a PropertyChangeEvent with parameter firePropertyName.

      Type Parameters:
      X - the type of the value
      Parameters:
      name - name of DTO property
      firePropertyName - name to be used in PropertyChangeEvent
      value - new value of property
      Since:
      1.2.9