# US 9,354,948 B2 · Data models containing host language embedded constraints

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,354,948 B2
- Document ID: US9354948B2
- Status: Granted
- Kind: B2
- Application number: 14/020,657
- Filed: 2013-09-06
- Published: 2015-03-12
- Granted: 2016-05-31
- Earliest claimed: 2013-09-06
- Assignees: Sap SE
- Applicants: Stefan Baeuerle; Timm Falter; Daniel Hutzel; Lior Schejter
- Inventors: Stefan Baeuerle; Timm Falter; Daniel Hutzel; Lior Schejter
- Web page: https://patentgrep.com/patent/US9354948B2

## CPC

- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F 11/36: Prevention of errors by analysis, debugging or testing of software
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are described for expressing a constraint in a host language. A constraint can be defined in the host language as an event handler. The event handler can be registered to a built-in event associated with an object of the database that the constraint is intended to validate. When the object triggers the built-in event, the event handler is called to execute the constraint. Exemplary built-in events include onSave (trigger the event when the object is saved), onValidate (trigger the event when an explicit call to validate the object is detected), onInsert (trigger the event when the object is inserted), onUpdate (trigger the event when the object is updated), and onCheckBeforeSave (trigger the event when the object is checked prior to saving).

## Claims

### Claim 1

A computer-implemented method comprising:
receiving, on an in-memory database engine, a first event handler containing code configured to validate a first entity comprising an object in an in-memory database and including a constraint derived from a second entity of an Entity-Relationship Model defined by an extension of Structured Query Language to include an association type comprising a first parameter clause specifying a cardinality, and a second parameter clause specifying a foreign key, wherein an application configured to manage the in-memory database and the first event handier are in a host language different than SQL;
identifying, by the in-memory database engine and according to the first event handler, a built-in event associated with the first entity;
registering, by the in-memory database engine, the first event handler to the built-in event;
evaluating the constraint by referencing the cardinality and the foreign key,
wherein the application automatically calls the first event handler when the built-in event is triggered; and
wherein the in-memory database engine includes at least one service, data definition, or data processing based on an Entity-Relationship Model and at least one service, data definition, or data processing based on a Relational Model.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
receiving, on the in-memory database engine, a second event handler configured to validate the first entity, wherein the second event handler is in the host language;
identifying, by the in-memory database engine and according to the second event handler, the built-in event associated with the first entity; and
registering, by the in-memory database engine, the second event handler to the built-in event,
wherein the application automatically calls the second event handler when the built-in event is triggered, and
wherein the first event handler and the second event handler are executed in parallel.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein the first event handler and the second event handler are executed on separate threads.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the calling the first event handler comprises executing the first event handler on a separate thread than the application.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the built-in event is detecting that the first entity is modified.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the built-in event is detecting an explicit call to the built-in event.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein the explicit call is a built-in validate action belonging to the first entity.

### Claim 8

A non-transitory computer readable storage medium storing one or more programs, the one or more programs comprising instructions for:
receiving, on an in-memory database engine, a first event handier containing code configured to validate a first entity comprising an object in an in-memory database and including a constraint derived from a second entity of an Entity-Relationship Model defined by an extension of Structured Query Language (SQL) Language to include an association type comprising a first parameter clause specifying a cardinality, and a second parameter clause specifying a foreign key, wherein an application configured to manage the in-memory database and the first event handler are in a host language different than SQL;
identifying, by the in-memory database engine and according to the first event handler, a built-in event associated with the first entity; and
registering, by the in-memory database engine, the first event handler to the built-in event;
evaluating the constraint by referencing the cardinality and the foreign key,
wherein the application automatically calls the first event handler when the built-in event is triggered; and
wherein the in-memory database engine includes at least one service, data definition, or data processing based on an Entity-Relationship Model and at least one service, data definition, or data processing based on a Relational Model.

### Claim 9 (depends on 8)

The non-transitory computer readable storage medium of claim 8, further comprising:
receiving, on the in-memory database engine, a second event handler configured to validate the first entity, wherein the second event handler is in the host language;
identifying, by the in-memory database engine and according to the second event handler, the built-in event associated with the first entity; and
registering, by the in-memory database engine, the second event handler to the built-in event,
wherein the application automatically calls the second event handler when the built-in event is triggered, and
wherein the first event handler and the second event handler are executed in parallel.

### Claim 10 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein the first event handler and the second event handler are executed on separate threads.

### Claim 11 (depends on 8)

The non-transitory computer readable storage medium as in claim 8, wherein the calling the first event handler comprises executing the first event handler on a separate thread than the application.

### Claim 12 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the built-in event is detecting that the first entity is modified.

### Claim 13 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the built-in event is detecting an explicit call to the built-in event.

### Claim 14 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the explicit call is a built-in validate action belonging to the first entity.

### Claim 15

A computer system comprising:
ail in-memory database engine; and
a non-transitory computer readable medium having stored thereon one or more programs, which when executed by the in-memory database engine, causes the in-memory database engine to:
receive a first event handler containing code configured to validate a first entity comprising an object in an in-memory database including a constraint derived from a second entity of an Entity-Relationship Model defined by an extension of Structured Query Language (SQL) Language to include an association type comprising a first parameter clause specifying a cardinality, and a second parameter clause specifying a foreign key, wherein an application configured to manage the in-memory database and the first event handier are in a host language different than SQL;
identify according to the first event handler, a built-in event associated with the first entity;
register the first event handier to the built-in event; and
evaluate the constraint by referencing the cardinality and the foreign key, wherein the application automatically calls the first event handler when the built-in event is triggered; and
wherein the in-memory database engine includes at least one service data definition, or data processing based on an Entity-Relationship Model and at least one service, data definition, or data processing based on a Relational Model.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein the one or more programs, which when executed by the in-memory database engine, further cause the in-memory database engine to:
receive a second event handler configured to validate the first entity, wherein the second event handler is in the host language;
identify according to the second event handler, the built-in event associated with the first entity; and
register the second event handler to the built-in event,
wherein the application automatically calls the second event handler when the built-in event is triggered, and
wherein the first event handler and the second event handler are executed in parallel.

### Claim 17 (depends on 16)

The computer system of claim 16, wherein the first event handler and the second event handler are executed on separate threads.

### Claim 18 (depends on 15)

The computer system of claim 15, wherein the calling the first event handler comprises executing the first event handler on a separate thread than the application.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein the built-in event is detecting that the first entity is modified.

### Claim 20 (depends on 15)

The computer system of claim 15, wherein the built-in event is detecting an explicit call to the built-in event.
