mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 07:12:25 +01:00
Update wikipage Data structures creation. (Signed-off-by:jocelyn).
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1529 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -79,7 +79,7 @@ Let us take an example:
|
||||
| template file extract
|
||||
| corresponding result file extract
|
||||
|-
|
||||
| attribute_count: <ACNT>
|
||||
| attribute_count: <code><ACNT></code>
|
||||
| attribute_count: 5
|
||||
|}
|
||||
|
||||
@@ -91,10 +91,8 @@ Let us take an example:
|
||||
| template file extract
|
||||
| corresponding result file extract
|
||||
|-
|
||||
| <A:A:A><AN:L>: <TN:U> <br/>
|
||||
</A>
|
||||
| companyid: DOUBLE <br/>
|
||||
companyname: STRING
|
||||
| <code><A:A:A><AN:L>: <TN:U></code> <br/><code></A></code>
|
||||
| <eiffel>companyid: DOUBLE</eiffel> <br/><eiffel>companyname: STRING</eiffel>
|
||||
|}
|
||||
|
||||
Text contained in the tag 'A' is mapped to each table (or view) attribute and the resulting texts are concatenated. Let us see now the details about each tag.
|
||||
@@ -118,7 +116,7 @@ The available tags for database table classes generation can be separated into 3
|
||||
| '''Option name'''
|
||||
| '''Option description'''
|
||||
|-
|
||||
| <CN:?>
|
||||
| <code><CN:?></code>
|
||||
| Table name
|
||||
| U
|
||||
| in uppercase
|
||||
@@ -129,7 +127,7 @@ The available tags for database table classes generation can be separated into 3
|
||||
| L
|
||||
| in lowercase
|
||||
|-
|
||||
| <ACNT>
|
||||
| <code><ACNT></code>
|
||||
| Attribute count
|
||||
| N/A
|
||||
|}
|
||||
@@ -144,7 +142,7 @@ The available tags for database table classes generation can be separated into 3
|
||||
| '''Option name'''
|
||||
| '''Option description'''
|
||||
|-
|
||||
| <AN:?>
|
||||
| <code><AN:?></code>
|
||||
| Attribute name
|
||||
| U
|
||||
| in uppercase
|
||||
@@ -155,11 +153,11 @@ The available tags for database table classes generation can be separated into 3
|
||||
| L
|
||||
| in lowercase
|
||||
|-
|
||||
| <IT>
|
||||
| <code><IT></code>
|
||||
| Attribute position in the table
|
||||
| N/A
|
||||
|-
|
||||
| <TN:?>
|
||||
| <code><TN:?></code>
|
||||
| Attribute type name
|
||||
| U
|
||||
| in uppercase
|
||||
@@ -170,7 +168,7 @@ The available tags for database table classes generation can be separated into 3
|
||||
| L
|
||||
| in lowercase
|
||||
|-
|
||||
| <TDV>
|
||||
| <code><TDV></code>
|
||||
| Attribute type default value
|
||||
| N/A
|
||||
|}
|
||||
@@ -179,7 +177,7 @@ The available tags for database table classes generation can be separated into 3
|
||||
|
||||
=====2.3.1.3. Enclosing tags=====
|
||||
|
||||
The tag <A:?:?> </A> encloses text that will be mapped to attributes matching criteria. These criteria are specified by the tag options:
|
||||
The tag <code><A:?:?> </A></code> encloses text that will be mapped to attributes matching criteria. These criteria are specified by the tag options:
|
||||
* First option: attribute type criterion
|
||||
{| border="1"
|
||||
|-
|
||||
@@ -250,7 +248,7 @@ The meaning of available tags is so modified:
|
||||
| '''Tag name'''
|
||||
| '''Tag description'''
|
||||
|-
|
||||
| <ACNT>
|
||||
| <code><ACNT></code>
|
||||
| Table count
|
||||
|}
|
||||
|
||||
@@ -264,7 +262,7 @@ The meaning of available tags is so modified:
|
||||
| '''Option name'''
|
||||
| '''Option description'''
|
||||
|-
|
||||
| <CN:?>
|
||||
| <code><CN:?></code>
|
||||
| Table name
|
||||
| U
|
||||
| in uppercase
|
||||
@@ -275,14 +273,14 @@ The meaning of available tags is so modified:
|
||||
| L
|
||||
| in lowercase
|
||||
|-
|
||||
| <IT>
|
||||
| <code><IT></code>
|
||||
| Table position in the database
|
||||
| N/A
|
||||
|}
|
||||
|
||||
=====2.3.2.3. Enclosing tags=====
|
||||
|
||||
The tag <A:A:?> </A> encloses text that will be mapped to tables matching a position criterion. This criterion is specified by the tag options:
|
||||
The tag <code><A:A:?> </A></code> encloses text that will be mapped to tables matching a position criterion. This criterion is specified by the tag options:
|
||||
{| border="1"
|
||||
|-
|
||||
| '''Option name'''
|
||||
@@ -326,7 +324,7 @@ The wizard uses one different template for each class.
|
||||
===3.1. Table classes===
|
||||
|
||||
For each selected database table, a class is created from the same template, mapping the database table. This template is:
|
||||
<code>
|
||||
<eiffel>
|
||||
indexing
|
||||
description: "Class which allows EiffelStore to retrieve/store%
|
||||
%the content of a table row from database table <CN:U>"
|
||||
@@ -393,14 +391,14 @@ For each selected database table, a class is created from the same template, map
|
||||
|
||||
end -- class CODES
|
||||
|
||||
</code>
|
||||
</eiffel>
|
||||
|
||||
'''Note''': the template content can be adjusted, for instance to add comments or change the indexing. However, the fundamental template structure should not be changed to use data structures as described in the [[Data structures use|corresponding section]] .
|
||||
|
||||
===3.2. Description classes===
|
||||
|
||||
For each selected database table, a class is also created from a unique template, mapping the database table. This template is:
|
||||
<code>
|
||||
<eiffel>
|
||||
indexing
|
||||
description: "Description of class <CN:U>"
|
||||
author: "EiffelStore Wizard"
|
||||
@@ -566,19 +564,19 @@ For each selected database table, a class is also created from a unique template
|
||||
-- Piece of <CN:L> associated with the description
|
||||
|
||||
end -- class CODES_DESCRIPTION
|
||||
</code>
|
||||
</eiffel>
|
||||
|
||||
'''Note''': As for the table class generation, the template content can be adjusted, for instance to add comments or change the indexing. However, the fundamental template structure should not be changed.
|
||||
|
||||
Some additional tags are directly replaced by the wizard:
|
||||
* The <CR> and <DR> tags are replaced with information on associated tables.
|
||||
* The <IC> tag is replaced by information on the primary key (table ID).
|
||||
* The <CI> tag is replaced by the table position in the database.
|
||||
* The <code><CR></code> and <code><DR></code> tags are replaced with information on associated tables.
|
||||
* The <code><IC></code> tag is replaced by information on the primary key (table ID).
|
||||
* The <code><CI></code> tag is replaced by the table position in the database.
|
||||
|
||||
===2.3.3. Access class===
|
||||
|
||||
The <eiffel>DB_SPECIFIC_TABLES_ACCESS</eiffel> class is mapped to the database from the following template:
|
||||
<code>
|
||||
<eiffel>
|
||||
indexing
|
||||
description: "Description of database tables.%
|
||||
%Use this class through DB_SPECIFIC_TABLES_ACCESS_USE."
|
||||
@@ -647,9 +645,5 @@ The <eiffel>DB_SPECIFIC_TABLES_ACCESS</eiffel> class is mapped to the database f
|
||||
</A>
|
||||
|
||||
end -- class DB_SPECIFIC_TABLES_ACCESS
|
||||
</code>
|
||||
|
||||
|
||||
|
||||
|
||||
</eiffel>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user