Package de.xima.fc.gui.model.appointment
Class AAppointmentClosingTimeModel<T extends AAppointmentClosingTime>
java.lang.Object
de.xima.fc.gui.model.appointment.AAppointmentClosingTimeModel<T>
- Type Parameters:
T
- Sub type ofAAppointmentClosingTime
.
- 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
ConstructorsConstructorDescriptionAAppointmentClosingTimeModel
(Class<T> entityClass) Creates a new empty model without any closing times. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds the given closing time to the list of all closing times.final void
addNew()
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
areSubtypePropertiesEqual
(T x, T y) Compares two closing times for whether they are equal.protected abstract T
protected abstract T
Creates a new, non-persisted entity and sets all fields required by the sub type (such as a reference to aclient
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
loadAll()
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
save()
Saves all closing times to the database.final void
setAllJsonString
(String json) Sets all items from the given serialized JSON string, which must be the same format asgetAllJsonString()
.
-
Constructor Details
-
AAppointmentClosingTimeModel
Creates a new empty model without any closing times.- Parameters:
entityClass
- Sub type ofAAppointmentClosingTime
.
-
-
Method Details
-
add
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
- 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
Sets all items from the given serialized JSON string, which must be the same format asgetAllJsonString()
.- Parameters:
json
- JSON string with the data to set.
-
addSubtypePropertiesToItem
When deserializing the JSON data received from the client. This method should read all properties from the JSON object that are not contained inAAppointmentClosingTime
, 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
When serializing an entity as JSON for the client. This method should add all properties from the sub type not contained inAAppointmentClosingTime
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
Compares two closing times for whether they are equal. Implementation only need to check for properties not present in theAAppointmentClosingTime
.- Parameters:
x
- One item to check.y
- Another item to check.- Returns:
- Whether the properties of two items are equal.
-
cloneItem
- 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
Creates a new, non-persisted entity and sets all fields required by the sub type (such as a reference to aclient
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.
-