Class AAppointmentClosingTimeModel<T extends AAppointmentClosingTime>

java.lang.Object
de.xima.fc.gui.model.appointment.AAppointmentClosingTimeModel<T>
Type Parameters:
T - Sub type of AAppointmentClosingTime.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AppointmentClientClosingTimeModel, AppointmentClosingTimeModel

public abstract class AAppointmentClosingTimeModel<T extends AAppointmentClosingTime> extends Object implements Serializable
The view model for the AAppointmentClosingTime.
Since:
8.0.0
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty model without any closing times.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    add(T closingTime)
    Adds the given closing time to the list of all closing times.
    final void
    Adds a new closing time to the list of all closing times.
    protected abstract void
    addSubtypePropertiesToItem(T item, com.alibaba.fastjson.JSONObject json)
    When deserializing the JSON data received from the client.
    protected abstract void
    addSubtypePropertiesToJson(com.alibaba.fastjson.JSONObject json, T item)
    When serializing an entity as JSON for the client.
    protected abstract boolean
    Compares two closing times for whether they are equal.
    protected abstract T
    cloneItem(T item)
     
    protected abstract T
    Creates a new, non-persisted entity and sets all fields required by the sub type (such as a reference to a client etc.).
    final String
     
    protected abstract de.xima.cmn.criteria.QueryCriteriaManager
    Creates the query criteria manager with the filter and sorting criteria for reading all applicable closing time entities from the database.
    final void
    Loads all available appointment closing times into this model.
    final void
    removeRows(int startInclusive, int endExclusive)
    Removes the rows at the given range.
    final void
    Saves all closing times to the database.
    final void
    Sets all items from the given serialized JSON string, which must be the same format as getAllJsonString().

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AAppointmentClosingTimeModel

      public AAppointmentClosingTimeModel(Class<T> entityClass)
      Creates a new empty model without any closing times.
      Parameters:
      entityClass - Sub type of AAppointmentClosingTime.
  • Method Details

    • add

      public final void add(T closingTime)
      Adds the given closing time to the list of all closing times.
      Parameters:
      closingTime - Closing time to add.
    • addNew

      public final void addNew()
      Adds a new closing time to the list of all closing times.
    • getAllJsonString

      public final String getAllJsonString()
      Returns:
      All closing times as a JSON string.
    • loadAll

      public final void loadAll()
      Loads all available appointment closing times into this model.
    • removeRows

      public final void removeRows(int startInclusive, int endExclusive)
      Removes the rows at the given range.
      Parameters:
      startInclusive - Start index of the range to remove, inclusive.
      endExclusive - End index of the range to remove, exclusive.
    • save

      public final void save()
      Saves all closing times to the database. Newly added closing times are created, modified closing times are updated, and removed closing times are deleted.
    • setAllJsonString

      public final void setAllJsonString(String json)
      Sets all items from the given serialized JSON string, which must be the same format as getAllJsonString().
      Parameters:
      json - JSON string with the data to set.
    • addSubtypePropertiesToItem

      protected abstract void addSubtypePropertiesToItem(T item, com.alibaba.fastjson.JSONObject json)
      When deserializing the JSON data received from the client. This method should read all properties from the JSON object that are not contained in AAppointmentClosingTime , and add those to the entity.
      Parameters:
      item - The entity to which the data should be added.
      json - JSON data for the item as received from the client.
    • addSubtypePropertiesToJson

      protected abstract void addSubtypePropertiesToJson(com.alibaba.fastjson.JSONObject json, T item)
      When serializing an entity as JSON for the client. This method should add all properties from the sub type not contained in AAppointmentClosingTime to the JSON object.
      Parameters:
      json - JSON object which will be passed to the client.
      item - Entity with the data to add to the JSON object.
    • areSubtypePropertiesEqual

      protected abstract boolean areSubtypePropertiesEqual(T x, T y)
      Compares two closing times for whether they are equal. Implementation only need to check for properties not present in the AAppointmentClosingTime.
      Parameters:
      x - One item to check.
      y - Another item to check.
      Returns:
      Whether the properties of two items are equal.
    • cloneItem

      protected abstract T cloneItem(T item)
      Parameters:
      item - An item to clone.
      Returns:
      A clone of the basic properties of the closing time, without the ID / UUID / locking version etc.
    • createNew

      protected abstract T createNew()
      Creates a new, non-persisted entity and sets all fields required by the sub type (such as a reference to a client etc.).
      Returns:
      A new closing time entity.
    • getFetchAllCriteria

      protected abstract de.xima.cmn.criteria.QueryCriteriaManager getFetchAllCriteria()
      Creates the query criteria manager with the filter and sorting criteria for reading all applicable closing time entities from the database.
      Returns:
      A criteria manager for fetching all applicable entities.