Startseite / Vorlagenentwicklung / Vorlagensyntax / Datentypen / Entity

Datentyp EntityVerfügbar ab FirstSpirit-Version 4.0

Wertebereich des Datentyps Entity

In den Tabellen der Datenquellen-Verwaltung können Datensätze gepflegt werden. Diese Datensätze können in FirstSpirit ausgegeben und weiterverarbeitet werden. Zusätzlich gibt es einige Eingabekomponenten, in denen sich ein oder mehrere Datensätze auswählen lassen.

Ein Datensatz wird durch den Datentyp Entity repräsentiert. Der Datensatz umfasst zum einen die einzelnen Spalten mit ihren Werten und zum anderen Metainformationen, wie z.B. den letzten Bearbeiter.

Weitere Informationen zum Datentyp Entity siehe API-Dokumentation: de.espirit.firstspirit.access.or.schema.Entity

Methoden auf Entity-Objekten

In der unten angegebenen Tabelle werden alle Methoden aufgelistet, die auf Objekten von Datentyp Entity aufgerufen werden können:

Methodenname Rückgabetyp Kurzbeschreibung Verfügbar seit
clear void
compute(Object, BiFunction) Object
computeIfAbsent(Object, Function) Object
computeIfPresent(Object, BiFunction) Object
containsKey(Object) boolean
containsValue(Object) boolean
copy Entity Copies this entity. 4.0.55
copyFrom(Entity) void Copy the values of the given entity to this entity. 4.0.17
copyOf(Map) Map
entry(Object, Object) Map$Entry
entrySet Set
equals(Object) boolean
forEach(BiConsumer) void
get(Set) Set
get(Collection) List
get(String) Object Wert zu einem Schlüssel
get(Object) Object
get(String, String) Object
getAttributeNames Collection Return a collection of the attributes declared for this entity. 4.0.17
getClass Class Klasse des aufrufenden Objektes
getDataset(TableTemplate) Dataset Dataset erhalten
getDataset(String) Dataset
getEditor User Der letzte Bearbeiter des Datensatzes
getEntityType EntityType Return the type of this entity. 4.0.17
getGid UUID Returns the gid of this entity, if the session supports gids and the gid is already created, else null. 5.0.100
getId Object
getIdentifier Identifier Return the identifier of this entity. 4.0.17
getKeyValue KeyValue Return the business key of this entity or null if this entity is in state NEW. 4.0.17
getLastChange Date
getList(String) List Return the value of the specified list attribute ("to N relation"). 4.0.55
getOrDefault(Object, Object) Object
getReleasedBy User
getSession Session Returns the session which was used to create or retrieve this entity. 4.0.17
getState Entity$PersistentState Return the state of this entity. 4.0.17
getValue(String) Object Return the value of the attribute specified by the given name. 4.0.17
getValue(Attribute) Object Return the value of the given attribute or null. 4.0.17
isCase(Object) boolean 4.2.14
isEmpty boolean Prüft, ob ein Ausdruck leer ist
isNull boolean Prüft, ob ein Ausdruck Null ist
isReleased boolean Return true if this entity is released else false. 4.0.17
isValid boolean Return true if this entity is valid else false. 4.0.17
keySet Set
merge(Object, Object, BiFunction) Object
of Map
of(Object, Object) Map
of(Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map
ofEntries(Map$Entry[]) Map
print void
put(Object, Object) Object
putAll(Map) void
putIfAbsent(Object, Object) Object
refresh void Refresh the content of this entity with the one stored in the database. 4.0.24
remove(Object) Object
remove(Object, Object) boolean
replace(Object, Object) Object
replace(Object, Object, Object) boolean
replaceAll(BiFunction) void
rollback void Revert all attribute changes. 4.0.17
rollbackWithRelations void Reset all changes, including relations (i.e. this may rollback delete operations of entities which has been set in relation to this entity). 4.0.416
set(String, Object) Object
set(Object, Object) Map
setValue(String, Object) void Set the value of the attribute with name to the given value. 4.0.17
setValue(Attribute, Object) void Set the value of the attribute attribute to value. 4.0.17
size int Anzahl der Schlüssel-/Wert-Paare
toJSON String Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value. 5.2.11
toString String
type String
values Collection

clear

Methodenname Rückgabetyp Verfügbar seit
clear void

compute(Object, BiFunction)

Methodenname Rückgabetyp Verfügbar seit
compute(Object, BiFunction) Object

computeIfAbsent(Object, Function)

Methodenname Rückgabetyp Verfügbar seit
computeIfAbsent(Object, Function) Object

computeIfPresent(Object, BiFunction)

Methodenname Rückgabetyp Verfügbar seit
computeIfPresent(Object, BiFunction) Object

containsKey(Object)

Methodenname Rückgabetyp Verfügbar seit
containsKey(Object) boolean

containsValue(Object)

Methodenname Rückgabetyp Verfügbar seit
containsValue(Object) boolean

copy

Copies this entity.
Methodenname Rückgabetyp Verfügbar seit
copy Entity 4.0.55

copyFrom(Entity)

Copy the values of the given entity to this entity.
Methodenname Rückgabetyp Verfügbar seit
copyFrom(Entity) void 4.0.17

copyOf(Map)

Methodenname Rückgabetyp Verfügbar seit
copyOf(Map) Map

entry(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
entry(Object, Object) Map$Entry

entrySet

Methodenname Rückgabetyp Verfügbar seit
entrySet Set

equals(Object)

Methodenname Rückgabetyp Verfügbar seit
equals(Object) boolean

forEach(BiConsumer)

Methodenname Rückgabetyp Verfügbar seit
forEach(BiConsumer) void

get(Set)

Methodenname Rückgabetyp Verfügbar seit
get(Set) Set

get(Collection)

Methodenname Rückgabetyp Verfügbar seit
get(Collection) List

get(String)

In einer Map sind Schlüssel-/Wert-Paare enthalten. Mit der Methode .get(String) kann der Wert zu dem übergebenen Schlüssel ermittelt werden.

Wenn in einer Map folgende Schlüssel-/Wert-Paare enthalten sind:

1. Paar: Schlüssel="Max", Wert="Mustermann"
2. Paar: Schlüssel="Franz", Wert="Meier"
3. Paar: Schlüssel="Peter", Wert="Müller"

führt der Aufruf

MAP.get("Franz")

zur Rückgabe einer Zeichenkette (vgl. java.lang.String ) mit dem Inhalt

Meier
Methodenname Rückgabetyp Verfügbar seit
get(String) Object

get(Object)

Methodenname Rückgabetyp Verfügbar seit
get(Object) Object

get(String, String)

Methodenname Rückgabetyp Verfügbar seit
get(String, String) Object

getAttributeNames

Return a collection of the attributes declared for this entity.
Methodenname Rückgabetyp Verfügbar seit
getAttributeNames Collection 4.0.17

getClass

Die Methode .getClass() (in Bean-Syntax: .class) liefert die Klasse des aufrufendes Objektes zurück (vgl. java.lang.Class).

Aufruf:

$CMS_VALUE(myString.class)$
$CMS_VALUE(myString.getClass())$

Ausgabe:

java.lang.String
Methodenname Rückgabetyp Verfügbar seit
getClass Class

getDataset(TableTemplate)

Mithilfe dieser Methode kann in einer Vorlage aus einer Entity (die beispielsweise von der contentSelect-Funktion erzeugt wird) ein Dataset ermittelt werden.
Die Methode erwartet die Angabe des Referenznamens der betreffenden Tabellenvorlage in Anführungszeichen.

Beispiel:

$CMS_FOR(_entity, cs_press_releases)$
$CMS_SET(_dataset, _entity.getDataset("products.product"))$
$-- ... --$
$CMS_END_FOR$

Dabei ist cs_press_releases die Variable / der Bezeichner der contentSelect-Funktion, products.product der Referenzname der Tabellenvorlage.

Alternativ kann folgende Schreibweise verwendet werden. Bei dieser erfolgt die Umwandlung bereits beim Aufruf der FOR-Schleife.

$CMS_FOR(_dataset, cs_press_releases.map(entity->entity.getDataset("products.product")))$
$-- ... --$
$CMS_END_FOR$

Kann das Dataset nicht ermittelt werden, wird null zurückgeliefert.

Methodenname Rückgabetyp Verfügbar seit
getDataset(TableTemplate) Dataset

getDataset(String)

Methodenname Rückgabetyp Verfügbar seit
getDataset(String) Dataset

getEditor

Die Methode .getEditor() liefert den letzten Bearbeiter des Datensatzes zurück. Mit dem zurückgelieferten User-Objekt können Informationen zum Bearbeiter ausgegeben werden, z. B. Abkürzung, Name usw.

Methodenname Rückgabetyp Verfügbar seit
getEditor User

getEntityType

Return the type of this entity.
Methodenname Rückgabetyp Verfügbar seit
getEntityType EntityType 4.0.17

getGid

Returns the gid of this entity, if the session supports gids and the gid is already created, else null.
Methodenname Rückgabetyp Verfügbar seit
getGid UUID 5.0.100

getId

Methodenname Rückgabetyp Verfügbar seit
getId Object

getIdentifier

Return the identifier of this entity.
Methodenname Rückgabetyp Verfügbar seit
getIdentifier Identifier 4.0.17

getKeyValue

Return the business key of this entity or null if this entity is in state NEW.
Methodenname Rückgabetyp Verfügbar seit
getKeyValue KeyValue 4.0.17

getLastChange

Methodenname Rückgabetyp Verfügbar seit
getLastChange Date

getList(String)

Return the value of the specified list attribute ("to N relation").
Methodenname Rückgabetyp Verfügbar seit
getList(String) List 4.0.55

getOrDefault(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
getOrDefault(Object, Object) Object

getReleasedBy

Methodenname Rückgabetyp Verfügbar seit
getReleasedBy User

getSession

Returns the session which was used to create or retrieve this entity.
Methodenname Rückgabetyp Verfügbar seit
getSession Session 4.0.17

getState

Return the state of this entity.
Methodenname Rückgabetyp Verfügbar seit
getState Entity$PersistentState 4.0.17

getValue(String)

Return the value of the attribute specified by the given name.
Methodenname Rückgabetyp Verfügbar seit
getValue(String) Object 4.0.17

getValue(Attribute)

Return the value of the given attribute or null.
Methodenname Rückgabetyp Verfügbar seit
getValue(Attribute) Object 4.0.17

isCase(Object)

Methodenname Rückgabetyp Verfügbar seit
isCase(Object) boolean 4.2.14

isEmpty

Die Methode .isEmpty() (in Bean-Syntax: .isEmpty) prüft, ob ein Ausdruck bzw. Objekt leer ist, z. B. storeElement.isEmpty(). Das Ergebnis der semantischen Prüfung hängt vom Ausdruck bzw. Objekt ab, z. B. eine Zeichenkette ist dann leer, wenn sie kein Zeichen enthält. Bei Objekten mit komplexen Werten oder Objekten entscheidet das Objekt, wann es leer ist. Der Datentyp DomElement enthält beispielsweise immer ein leeres Dokument, ist also nie null. Die Prüfung einer leeren DOM-Editor-Eingabekomponente mit der Methode .isNull() liefert daher den Wert false, während die Prüfung der Komponente auf .isEmpty() den Wert true liefern würde.

Die Methode .isEmpty() gibt einen booleschen Wert als Ergebnis der Prüfung zurück. true (=wahr) ist die Prüfung, wenn der Ausdruck bzw. das Objekt leer ist und false (=unwahr) wenn nicht.

Methodenname Rückgabetyp Verfügbar seit
isEmpty boolean

isNull

Die Methode .isNull() (in Bean-Syntax: .isNull) prüft, ob ein Ausdruck bzw. Objekt Null ist, z. B. storeElement.isNull(). Bei Objekten mit komplexen Werten oder Objekten entscheidet das Objekt, wann es null ist. Der Datentyp DomElement enthält beispielsweise immer ein leeres Dokument, ist also nie null. Die Prüfung einer leeren DOM-Editor-Eingabekomponente mit der Methode .isNull() liefert daher den Wert false, während die Prüfung der Komponente auf .isEmpty() den Wert true liefern würde.

Die Methode .isNull() gibt einen booleschen Wert als Ergebnis der Prüfung zurück. true (=wahr) ist die Prüfung, wenn der Ausdruck bzw. das Objekt Null ist und false (=unwahr) wenn nicht.

Methodenname Rückgabetyp Verfügbar seit
isNull boolean

isReleased

Return true if this entity is released else false.
Methodenname Rückgabetyp Verfügbar seit
isReleased boolean 4.0.17

isValid

Return true if this entity is valid else false.
Methodenname Rückgabetyp Verfügbar seit
isValid boolean 4.0.17

keySet

Methodenname Rückgabetyp Verfügbar seit
keySet Set

merge(Object, Object, BiFunction)

Methodenname Rückgabetyp Verfügbar seit
merge(Object, Object, BiFunction) Object

of

Methodenname Rückgabetyp Verfügbar seit
of Map

of(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object) Map

of(Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Map

ofEntries(Map$Entry[])

Methodenname Rückgabetyp Verfügbar seit
ofEntries(Map$Entry[]) Map

print

Methodenname Rückgabetyp Verfügbar seit
print void

put(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
put(Object, Object) Object

putAll(Map)

Methodenname Rückgabetyp Verfügbar seit
putAll(Map) void

putIfAbsent(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
putIfAbsent(Object, Object) Object

refresh

Refresh the content of this entity with the one stored in the database.
Methodenname Rückgabetyp Verfügbar seit
refresh void 4.0.24

remove(Object)

Methodenname Rückgabetyp Verfügbar seit
remove(Object) Object

remove(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
remove(Object, Object) boolean

replace(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
replace(Object, Object) Object

replace(Object, Object, Object)

Methodenname Rückgabetyp Verfügbar seit
replace(Object, Object, Object) boolean

replaceAll(BiFunction)

Methodenname Rückgabetyp Verfügbar seit
replaceAll(BiFunction) void

rollback

Revert all attribute changes.
Methodenname Rückgabetyp Verfügbar seit
rollback void 4.0.17

rollbackWithRelations

Reset all changes, including relations (i.e. this may rollback delete operations of entities which has been set in relation to this entity).
Methodenname Rückgabetyp Verfügbar seit
rollbackWithRelations void 4.0.416

set(String, Object)

Methodenname Rückgabetyp Verfügbar seit
set(String, Object) Object

set(Object, Object)

Methodenname Rückgabetyp Verfügbar seit
set(Object, Object) Map

setValue(String, Object)

Set the value of the attribute with name to the given value.
Methodenname Rückgabetyp Verfügbar seit
setValue(String, Object) void 4.0.17

setValue(Attribute, Object)

Set the value of the attribute attribute to value.
Methodenname Rückgabetyp Verfügbar seit
setValue(Attribute, Object) void 4.0.17

size

Die Methode .size() (in Bean-Syntax: .size) liefert die Anzahl der Schlüssel-/Wert-Paare in einer Map zurück.

Das Rückgabeobjekt ist eine Ganzzahl (siehe java.lang.Integer).

Methodenname Rückgabetyp Verfügbar seit
size int

toJSON

Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value.
Methodenname Rückgabetyp Verfügbar seit
toJSON String 5.2.11

toString

Methodenname Rückgabetyp Verfügbar seit
toString String

type

Methodenname Rückgabetyp Verfügbar seit
type String

values

Methodenname Rückgabetyp Verfügbar seit
values Collection

© 2005 - 2024 Crownpeak Technology GmbH | Alle Rechte vorbehalten. | FirstSpirit 2024.4 | Datenschutz