Class AAppointmentClosingTimeModel<T extends AAppointmentClosingTime>

    • Constructor Detail

      • AAppointmentClosingTimeModel

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

      • 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.