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 theAAppointmentClosingTime
.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AAppointmentClosingTimeModel(Class<T> entityClass)
Creates a new empty model without any closing times.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(T closingTime)
Adds the given closing time to the list of all closing times.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
cloneItem(T item)
protected abstract T
createNew()
Creates a new, non-persisted entity and sets all fields required by the sub type (such as a reference to aclient
etc.).String
getAllJsonString()
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.void
loadAll()
Loads all available appointment closing times into this model.void
removeRows(int startInclusive, int endExclusive)
Removes the rows at the given range.void
save()
Saves all closing times to the database.void
setAllJsonString(String json)
Sets all items from the given serialized JSON string, which must be the same format asgetAllJsonString()
.
-
-
-
Constructor Detail
-
AAppointmentClosingTimeModel
public AAppointmentClosingTimeModel(Class<T> entityClass)
Creates a new empty model without any closing times.- Parameters:
entityClass
- Sub type ofAAppointmentClosingTime
.
-
-
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 asgetAllJsonString()
.- 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 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
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 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
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 theAAppointmentClosingTime
.- 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 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.
-
-