A method for flexibly storing data relating to an object-oriented domain model including a server having access to a cache memory device holding the data, wherein the cache memory device includes a tree-based storage structure comprising a tree of nodes, a server being connected to a number of devices being represented by Java entity objects related to Java models, each Java model in particular including at least one class, the server furthermore being connected to a database for persisting data held in the cache memory device, characterized by the method including the following steps: a) assigning to a particular Java entity object representing a device of the number of devices a meta entity container including fully qualified name of the Java entity object, the FQN representing the location of the Java entity object in the tree of nodes in the cache memory device; b) creating a unique identity identification and assigning this ID to the FQN and storing this ID in the meta entity container including the FQN, which meta entity container is stored in a cache or a separate section of the cache memory device; c) assigning a unique key to the Java entity model or class thereof representing the device in the domain model; d) assigning the ID to the key and assigning the data to be persisted to the ID and key and forming a mapping data container therewith and storing this mapping data container in a cache or a separate section of the cache memory device; and e) storing the mapping data container in a memory, wherein the unique ID is suitable to work as a pointer to a certain storing position of the persisted data in the table structure of the database, wherein in case persisted data have to be retrieved from the database, the persisted data are searched for in the searchable data stored in particular in the cache, to provide at least one or a multiplicity of mapping data containers including the searched data, in case said data have been persisted; based on the ID included in the at least one mapping data container, accessing the matching location in the database for transmitting the data to the cache memory device, wherein the key assigned to the ID is used to reload the persisted data into the corresponding Java entity model forming a Java entity object at a corresponding location in the tree of nodes in the cache memory device; using the mapping data container related to the ID to identify the matching Java entity model in the object-oriented domain model. a) assigning to a particular Java entity object representing a device of the number of devices a meta entity container including fully qualified name of the Java entity object, the FQN representing the location of the Java entity object in the tree of nodes in the cache memory device; b) creating a unique identity identification and assigning this ID to the FQN and storing this ID in the meta entity container including the FQN, which meta entity container is stored in a cache or a separate section of the cache memory device; c) assigning a unique key to the Java entity model or class thereof representing the device in the domain model; d) assigning the ID to the key and assigning the data to be persisted to the ID and key and forming a mapping data container therewith and storing this mapping data container in a cache or a separate section of the cache memory device; and e) storing the mapping data container in a memory, wherein the unique ID is suitable to work as a pointer to a certain storing position of the persisted data in the table structure of the database,