IP Library Granted Patent US 11,023,499
Granted Patent B2
US 11,023,499 · App. 16/203,454 · Granted Jun 1, 2021

Object relational mapping for relational databases

Inventor: Jens Schauder (Braunschweig, DE)
Assignee: Pivotal Software, Inc.
G06F16/288G06F16/244G06F16/245G06F16/252G06F16/24552
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,023,499
App. No.
16/203,454
Granted
Jun 1, 2021
Kind
B2
Abstract

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for enforcing a mapping between entities in a database and aggregates in an application framework. One of the methods includes receiving a request to populate a program object corresponding to an entity in a first relation of a relational database, the relational database is queried to obtain values for one or more attributes of the entity in the first relation and a plurality of identifiers that each identify a respective entity in the second relation of the relational database. The program object is populated with an aggregate having a complete collection of identifiers representing an m-to-n relationship in the database.

Claims (61)

1. A system comprising:

one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:

maintaining, by an application framework, a mapping between entities represented in a relational database and respective corresponding objects in a program being executed by the application framework, wherein manipulations in the program on program objects representing entities in the relational database causes the application framework to perform corresponding updates to one or more tuples in the relational database,

wherein the relational database includes a plurality of relations defining an m-to-n mapping relationship between entities in a first relation of the relational database and respective entities in a second relation of the relational database, and

wherein the application framework enforces that program objects representing entities in the first relation are represented as aggregates having a complete set of identifiers of related entities in the second relation;

receiving, by the application framework, a request to populate a first attribute of a first program object, wherein the first program object corresponds to a first entity in the first relation of the relational database, wherein the m-to-n mapping relationship in the relational database defines one or more references from the first entity to respective related entities in the second relation of the relational database;

in response to receiving the request to populate the first attribute of the first program object corresponding to the first entity, augmenting a query to request a value of the first attribute from the first relation and a complete set of identifiers of related entities to the first entity from a different relation of the relational database;

querying, by the application framework using the augmented query, the relational database to obtain the value of the first attribute of the first entity from the first relation and the complete set of identifiers that correspondingly identify the related entities to the first entity from the different relation of the relational database; and

populating, by the application framework, the first program object with an aggregate, the aggregate comprising the obtained value of the first attribute of the first entity from the first relation and the complete set of identifiers obtained from the different relation.

2. The system of claim 1 , wherein the operations further comprise:

receiving, by the application framework, an indication that the aggregate was updated by the program with information identifying a new entity in the second relation; and

in response, updating the m-to-n mapping relationship of the relational database with an identifier of the new entity in the second relation in response to the aggregate being updated by the program.

3. The system of claim 2 , wherein updating the m-to-n mapping relationship comprises:

deleting, from the m-to-n mapping relationship, all identifiers to which the first entity in the first relation is mapped; and

inserting, into the m-to-n mapping relationship, all identifiers identifying all entities in the second relation belonging to the aggregate.

4. The system of claim 1 , wherein the operations further comprise:

receiving, by the application framework, a request to save a new aggregate for an entity in the first relation comprising a plurality of identifiers for entities in the second relation; and

in response, inserting, into the m-to-n mapping relationship, all identifiers for the entities in the second relation belonging to the new aggregate.

5. The system of claim 1 , wherein the application framework is configured not to perform lazy loading of references to the identifiers for entities in the second relation.

6. The system of claim 1 , wherein the application framework is configured to always load all identifiers for entities in the second relation when populating program objects corresponding to entities in the first relation.

7. The system of claim 1 , wherein generating an aggregate comprises:

generating the aggregate to have only attributes of the first entity in the first relation or identifiers of aggregate roots of different aggregates.

8. The system of claim 1 , wherein the different relation is a bridge table representing relationships between entities in the first relation and the second relation.

9. The system of claim 1 , wherein the different relation is the second relation.

10. The system of claim 1 , further comprising:

transparently generating aggregates for each of the related entities, each aggregate for each related entity having a complete set of identifiers of correspondingly related entities from the first relation.

11. The system of claim 1 , wherein the application framework does not allow aggregate entities to reference entities in other aggregates.

12. A method comprising:

maintaining, by an application framework, a mapping between entities represented in a relational database and respective corresponding objects in a program being executed by the application framework, wherein manipulations in the program on program objects representing entities in the relational database causes the application framework to perform corresponding updates to one or more tuples in the relational database,

wherein the relational database includes one or more a plurality of relations defining an m-to-n mapping relationship between entities in a first relation of the relational database and respective entities in a second relation of the relational database, and

wherein the application framework enforces that program objects representing entities in the first relation are represented as aggregates having a complete set of identifiers of related entities in the second relation;

receiving, by the application framework, a request to populate a first attribute of a first program object, wherein the first program object corresponds corresponding to a first entity in the first relation of the relational database, wherein the m-to-n mapping relationship in the relational database defines one or more references from the first entity to respective related entities in the second relation of the relational database;

in response to receiving the request to populate the first attribute of the first program object corresponding to the first entity, augmenting a query to request a value of the first attribute from the first relation and a complete set of identifiers of related entities to the first entity from a different relation of the relational database;

querying, by the application framework using the augmented query, the relational database to obtain the value of the first attribute values for one or more attributes of the first entity from the first relation and the complete set of identifiers that correspondingly identify the related entities to the first respective entity from the different relation of the relational database; and

populating, by the application framework, the first program object with an aggregate, the aggregate comprising the obtained value of the first attribute of the first entity from the first relation and the complete set of identifiers obtained from the different relation.

13. The method of claim 12 , further comprising:

receiving, by the application framework, an indication that the aggregate was updated by the program with information identifying a new entity in the second relation; and

in response, updating the m-to-n mapping relationship of the relational database with an identifier of the new entity in the second relation in response to the aggregate being updated by the program.

14. The method of claim 13 , further comprising:

deleting, from the m-to-n mapping relationship, all identifiers to which the first entity in the first relation is mapped; and

inserting, into the m-to-n mapping relationship, all identifiers identifying all entities in the second relation belonging to the aggregate.

15. The method of claim 12 , further comprising:

receiving, by the application framework, a request to save a new aggregate for an entity in the first relation comprising a plurality of identifiers for entities in the second relation; and

in response, inserting, into the m-to-n mapping relationship, all identifiers for the entities in the second relation belonging to the new aggregate.

16. The method of claim 12 , wherein the application framework is configured not to perform lazy loading of references to the identifiers for entities in the second relation.

17. The method of claim 12 , wherein the application framework is configured to always load all identifiers for entities in the second relation when populating program objects corresponding to entities in the first relation.

18. The method of claim 12 , wherein generating an aggregate comprises:

generating the aggregate to have only attributes of the first entity in the first relation or identifiers of aggregate roots of different aggregates.

19. One or more non-transitory computer storage media, comprising instructions what when executed by one or more computers cause the one or more computers to perform operations comprising:

maintaining, by an application framework, a mapping between entities represented in a relational database and respective corresponding objects in a program being executed by the application framework, wherein manipulations in the program on program objects representing entities in the relational database causes the application framework to perform corresponding updates to one or more tuples in the relational database,

wherein the relational database includes one or more a plurality of relations defining an m-to-n mapping relationship between entities in a first relation of the relational database and respective entities in a second relation of the relational database, and

wherein the application framework enforces that program objects representing entities in the first relation are represented as aggregates having a complete set of identifiers of related entities in the second relation;

receiving, by the application framework, a request to populate a first attribute of a first program object, wherein the first program object corresponds corresponding to a first entity in the first relation of the relational database, wherein the m-to-n mapping relationship in the relational database defines one or more references from the first entity to respective related entities in the second relation of the relational database;

in response to receiving the request to populate the first attribute of the first program object corresponding to the first entity, augmenting a query to request a value of the first attribute from the first relation and a complete set of identifiers of related entities to the first entity from a different relation of the relational database;

querying, by the application framework using the augmented query, the relational database to obtain the value of the first attribute values for one or more attributes of the first entity from the first relation and the complete set of identifiers that correspondingly identify the related entities to the first respective entity from the different relation of the relational database; and

populating, by the application framework, the first program object with an aggregate, the aggregate comprising the obtained value of the first attribute of the first entity from the first relation and the complete set of identifiers obtained from the different relation.

20. The computer storage media of claim 19 , the operations further comprising:

receiving, by the application framework, an indication that the aggregate was updated by the program with information identifying a new entity in the second relation; and

in response, updating the m-to-n mapping relationship of the relational database with an identifier of the new entity in the second relation in response to the aggregate being updated by the program.

21. The computer storage media of claim 19 , the operations further comprising:

generating the aggregate to have only attributes of the first entity in the first relation or identifiers of aggregate roots of different aggregates.

Assignments (2)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067102/0314 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 29, 2021
From: SCHAUDER, JENS
To: VMWARE, INC.
Reel/Frame 056104/0828 →
Continuity (1)
Related Publication 20200167374A1 · May 28, 2020
Cited By (1)
US 12,639,290