System and method for mapping object-oriented program code to a database layer
First Claim
1. A method implemented on a computing system having at least one processor comprising:
- providing a representation of an object-oriented set of data;
analyzing specified characteristics of each object represented in the object-oriented representation;
based on the analysis, generating a default object-relational (“
O/R”
) mapping that maps each object of the object-oriented representation to a relational database according to a set of default O/R mapping rules;
storing the O/R mapping on a storage medium;
wherein analyzing comprises identifying entity beans within the representation of the object-oriented set of data and wherein mapping comprises mapping each entity bean to a unique table in the relational database and further comprises identifying persistent fields for each entity bean within the representation of the object-oriented set of data and wherein mapping comprises mapping each persistent field to a column of the table mapped to the entity bean;
wherein the default O/R mapping rules specify that certain types of persistent fields are to be mapped only to certain types of database data types, wherein mapping comprises mapping each persistent field of a particular type to a column having a data type corresponding to the persistent field type;
wherein the default O/R mapping rules specify that one type of persistent field is a dependent-value persistent field and wherein the O/R mapping rules specify different types of O/R mappings for different dependent-value persistent fields;
mapping a first dependent-value persistent field to a single column of type java.sgl.Types.BLOB; and
mapping a second dependent-value persistent field to a set of columns;
wherein, as specified by the default O/R mapping rules, the second dependent-value persistent field is mapped to a set of columns only when the second dependent-value persistent field'"'"'s dependent-value class has an empty constructor and all of the second dependent-value persistent field'"'"'s fields are public.
2 Assignments
0 Petitions
Accused Products
Abstract
One embodiment of the invention employs techniques for providing a default object-relational mapping between persistent data objects (i.e., the objects that represent persistent data from a database) and a relational database. In a Java environment, for example, each entity bean is mapped to a particular database table, and each of the persistent fields within the entity bean are mapped to columns of the database table. Relationships between entity beans are expressed as mappings between primary keys and foreign keys within the database schema. Dependent-value persistent fields may be mapped to multiple columns or to a single column of a special Java type (java.sql.Types. BLOB). In addition, one embodiment of the invention generates a default database schema using the default O/R mapping by executing a series of SQL commands generating the tables and columns.
66 Citations
24 Claims
-
1. A method implemented on a computing system having at least one processor comprising:
-
providing a representation of an object-oriented set of data; analyzing specified characteristics of each object represented in the object-oriented representation; based on the analysis, generating a default object-relational (“
O/R”
) mapping that maps each object of the object-oriented representation to a relational database according to a set of default O/R mapping rules;storing the O/R mapping on a storage medium; wherein analyzing comprises identifying entity beans within the representation of the object-oriented set of data and wherein mapping comprises mapping each entity bean to a unique table in the relational database and further comprises identifying persistent fields for each entity bean within the representation of the object-oriented set of data and wherein mapping comprises mapping each persistent field to a column of the table mapped to the entity bean; wherein the default O/R mapping rules specify that certain types of persistent fields are to be mapped only to certain types of database data types, wherein mapping comprises mapping each persistent field of a particular type to a column having a data type corresponding to the persistent field type; wherein the default O/R mapping rules specify that one type of persistent field is a dependent-value persistent field and wherein the O/R mapping rules specify different types of O/R mappings for different dependent-value persistent fields; mapping a first dependent-value persistent field to a single column of type java.sgl.Types.BLOB; and mapping a second dependent-value persistent field to a set of columns; wherein, as specified by the default O/R mapping rules, the second dependent-value persistent field is mapped to a set of columns only when the second dependent-value persistent field'"'"'s dependent-value class has an empty constructor and all of the second dependent-value persistent field'"'"'s fields are public. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer system including at least one processor comprising:
-
a deployment descriptor providing a representation of an object-oriented set of data; object-relational (“
O/R”
) generation logic to analyze specified characteristics of each object represented in the object-oriented representation; and
based on the analysis, to generate a default object-relational (“
O/R”
) persistence description that maps each object of the object-oriented representation to a relational database according to a set of default O/R mapping rules, and to store the default O/R persistence description in a storage medium;wherein analyzing comprises identifying entity beans within the representation of the object-oriented set of data and wherein mapping comprises mapping each entity bean to a unique table in the relational database and further comprises identifying persistent fields for each entity bean within the representation of the object-oriented set of data and wherein mapping comprises mapping each persistent field to a column of the table mapped to the entity bean; wherein the default O/R mapping rules specify that certain types of persistent fields are to be mapped only to certain types of database data types, wherein mapping comprises mapping each persistent field of a particular type to a column having a data type corresponding to the persistent field type; wherein, according to the O/R massing rules, the O/R mapping generation logic maps a first dependent-value persistent field to a single column of type java.sql.Types.BLOB; and
maps a second dependent-value persistent field to a set of columns; andwherein, as specified by the default O/R massing rules, the O/R massing generation logic maps the second dependent-value persistent field to a set of columns only when the second dependent-value persistent field'"'"'s dependent-value class has an empty constructor and all of the second dependent-value persistent field'"'"'s fields are public. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. An article of manufacture including program code which, when executed by a machine, causes the machine to perform the operations of:
-
providing a representation of an object-oriented set of data; analyzing specified characteristics of each object represented in the object-oriented representation; and based on the analysis, generating a default object-relational (“
O/R”
) mapping that maps each object of the object-oriented representation to a relational database according to a set of default O/R mapping rules;wherein analyzing comprises identifying entity beans within the representation of the object-oriented set of data and wherein mapping comprises mapping each entity bean to a unique table in the relational database and further comprises identifying persistent fields for each entity bean within the representation of the object-oriented set of data and wherein mapping comprises mapping each persistent field to a column of the table mapped to the entity bean; wherein the default O/R mapping rules specify that certain types of persistent fields are to be mapped only to certain types of database data types, wherein mapping comprises mapping each persistent field of a particular type to a column having a data type corresponding to the persistent field type; wherein the default O/R mapping rules specify that one type of persistent field is a dependent-value persistent field and wherein the O/R mapping rules specify different types of O/R mappings for different dependent-value persistent fields; mapping a first dependent-value persistent field to a single column of type java.sql.Types.BLOB; and mapping a second dependent-value persistent field to a set of columns, wherein, as specified by the default O/R mapping rules, the second dependent-value persistent field is mapped to a set of columns only when the second dependent-value persistent field'"'"'s dependent-value class has an empty constructor and all of the second dependent-value persistent field'"'"'s fields are public. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
-
Specification