Author:admin

Date:2008-09-25T16:19:15.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@44 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2008-09-25 16:19:15 +00:00
parent 7d4e6a18b3
commit 2780526eae
234 changed files with 374 additions and 382 deletions

View File

@@ -27,7 +27,7 @@ Name: smith
Password: mypass
</code>
{{note| '''Note:''' '' Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted ''.'' }}
{{note|Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted ''.'' }}
* For Oracle:
<code>
@@ -36,7 +36,7 @@ Name: smith@HANDSON
Password: mypass
</code>
{{note| '''Note:''' you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
{{note|you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
Then you can enter standard SQL queries to interact with your database, for instance:
@@ -46,7 +46,7 @@ John Smith
SQL>
</code>
{{note| '''Note:''' enter ''exit'' to quit the application. }}
{{note|enter ''exit'' to quit the application. }}
==Under the Hood==

View File

@@ -31,7 +31,7 @@ Name: smith
Password: mypass
</code>
{{note| '''Note:''' '' Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted ''.'' }}
{{note|Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted ''.'' }}
* For Oracle:
<code>
@@ -42,7 +42,7 @@ Name: smith@HANDSON
Password: mypass
</code>
{{note| '''Note:''' you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
{{note|you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
Then you can insert a book in the database, for instance:
@@ -64,7 +64,7 @@ Double value? 12.675
Object inserted
</code>
{{note| '''Note:''' if your database does not contain a <eiffel>DB_BOOK</eiffel> table, this example will create it. }}
{{note|if your database does not contain a <eiffel>DB_BOOK</eiffel> table, this example will create it. }}
==Under the Hood==

View File

@@ -40,7 +40,7 @@ Name: smith
Password: mypass
</code>
{{note| '''Note:''' '' Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted. }}
{{note|Name'' and ''Password'' are no required with ODBC. If you don't need ''Name'' and ''Password'', you can simply hit '''Return''' when prompted. }}
* For Oracle:
<code>
@@ -49,7 +49,7 @@ Name: smith@HANDSON
Password: mypass
</code>
{{note| '''Note:''' you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
{{note|you have to specify the Oracle User Name and Net Service Name with the syntax ''<user>@<service> ''where ''<user>'' stands for the User Name and ''<service>'' stands for the Net Service Name. }}
Then you can select rows from this table with author's name, for instance:
@@ -77,7 +77,7 @@ First publication:07/01/1992 12:00:00.0 AM
Author? ('exit' to terminate):
</code>
{{note| '''Note:''' enter ''exit'' to quit the application. }}
{{note|enter ''exit'' to quit the application. }}
==Under the Hood==

View File

@@ -179,7 +179,7 @@ Table components can be associated to reflect relation of database tables repres
* 1 master component enables to manually select database table rows.
* Slave components automatically select table rows that are associated to the current table row of the master component.
{{note| '''Note''': Notice that table associations can be '''nested'''. }}
{{note|Notice that table associations can be '''nested'''. }}
2 types of associations are possible to reflect table relations:
* The slave table is dependent on the master table (1:N relationship)
@@ -265,7 +265,7 @@ Basic relationship between table component class and navigation class
DV_TABLEROWS_NAVIGATOR clients
{{note| '''Note''': DV_TABLEROWS_COMPONENT class merely carries a set of table rows and enables to select one table row. }}
{{note|DV_TABLEROWS_COMPONENT class merely carries a set of table rows and enables to select one table row. }}
DV_CONTROL_NAVIGATOR affords a way to navigate among searched table rows.
@@ -275,7 +275,7 @@ This class enables 2 navigation systems:
* Navigating among table rows with "previous" and "next" controllers.
* Navigating among table rows through a display list.
{{tip| '''Tip''': Notice that both systems can be used. }}
{{tip|Notice that both systems can be used. }}
You can directly set [[#dv_s_control| controllers]] for "previous" and"next" actions. A 3rd controller, "edit list", enables to show or raise the display list.
@@ -384,9 +384,9 @@ This cluster provides the model with an interface to input or output data on the
The [[ref:libraries/store/reference/dv_sensitive_control_chart|DV_SENSITIVE_CONTROL]] class lets a model class trigger a specific action on a determined user event. Furthermore, the model class lets the user know when its state enables to trigger the action, by setting the controller sensitivity (i.e. if the controller is insensitive, the action cannot be triggered).
{{note| '''Note''': sensitivity excepted, these controllers could have been implemented by Eiffel ''agents''. }}
{{note|sensitivity excepted, these controllers could have been implemented by Eiffel ''agents''. }}
{{note| '''Note''': sensitivity enables to let the user know ''before''triggering an action if this is possible or not. The other possibility is to let the user know ''after'' trying to trigger the action that it was not possible(with a warning for instance): this is often less convenient. }}
{{note|sensitivity enables to let the user know ''before''triggering an action if this is possible or not. The other possibility is to let the user know ''after'' trying to trigger the action that it was not possible(with a warning for instance): this is often less convenient. }}
The standard controllers are buttons or menu items: the specific action is triggered when button is clicked or menu item selected.
@@ -400,7 +400,7 @@ The standard graphical widgets to perform this are text fields, but several othe
* A combo-box so that the interface can suggest different values.
* A label if the text only need to be output.
{{note| '''Note''': customized, specific widgets can be defined, you can for instance take a look at the DV_STRING_LIST class. }}
{{note|customized, specific widgets can be defined, you can for instance take a look at the DV_STRING_LIST class. }}
===5.3. DV_SENSITIVE_INTEGER class===
@@ -425,7 +425,7 @@ The [[ref:libraries/store/reference/dv_tablerow_list_chart|DV_TABLEROW_LIST]] c
[[ref:libraries/store/reference/dv_tablerow_multilist_chart|DV_TABLEROW_MULTILIST]] implements DV_TABLEROW_LIST with an EiffelVision2 multi-column list.
{{note| '''Note''': This class is used for the [[#dv_control_navigator|standard implementation]] of [[ref:libraries/store/reference/dv_tablerows_navigator_chart|DV_TABLEROW_NAVIGATOR]] to [[#dv_tablerow_navigator|navigate among table rows]] selected from the database. }}
{{note|This class is used for the [[#dv_control_navigator|standard implementation]] of [[ref:libraries/store/reference/dv_tablerows_navigator_chart|DV_TABLEROW_NAVIGATOR]] to [[#dv_tablerow_navigator|navigate among table rows]] selected from the database. }}

View File

@@ -45,7 +45,7 @@ You can then access or modify [[ref:libraries/store/reference/db_table_flatshort
end
</code>
{{note| '''Note:''' to access attributes data with ''code'', you need to use the [[ref:/libraries/store/reference/db_table_description_flatshort|DB_TABLE_DESCRIPTION]] object associated to your [[ref:libraries/store/reference/db_table_flatshort|DB_TABLE]] object. }}
{{note|to access attributes data with ''code'', you need to use the [[ref:/libraries/store/reference/db_table_description_flatshort|DB_TABLE_DESCRIPTION]] object associated to your [[ref:libraries/store/reference/db_table_flatshort|DB_TABLE]] object. }}
===2.3. Getting objects metadata===
@@ -168,7 +168,7 @@ As seen in the previous section, to manipulate abstract table/view rows content,
As descriptions are unique, this means that description objects are also associated to a specific table object to deal with it (i.e. access or modify its content). Actually, the table_description feature associates the description with the current object and then returns this description.
{{note| '''Note:''' The table_description feature is still a query as the association part should not be visible at the interface level. }}
{{note|The table_description feature is still a query as the association part should not be visible at the interface level. }}
On the whole, you have to pay attention to always execute table_descriptionon your table/view row to get the appropriate description.

View File

@@ -64,7 +64,7 @@ Let us give some details about the set_base feature:
** Login information.
** Status information.
{{note| '''Note''': When database is inactive, its information is stored in the <eiffel>DATABASE_APPL</eiffel> object. }}
{{note|When database is inactive, its information is stored in the <eiffel>DATABASE_APPL</eiffel> object. }}
The corresponding code looks like:
@@ -82,7 +82,7 @@ The corresponding code looks like:
...
</code>
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[EiffelStore Interface Layer|The interface layer]] <br/>
}}

View File

@@ -3,7 +3,7 @@
[[Property:uuid|ef5568ff-dc7c-4c85-0174-335fdab1bd84]]
Use the [[ref:/libraries/store/reference/db_change_flatshort|DB_CHANGE]] class to perform any operation on your database that does not require access to a result. You can for instance modify table row content, drop table rows, create and delete tables.
{{note| '''Note''': Take a look at the [[Data Object Coupling|Data Storing]] capability if you want to '''insert''' table rows. }}
{{note|Take a look at the [[Data Object Coupling|Data Storing]] capability if you want to '''insert''' table rows. }}
[[ref:/libraries/store/reference/db_change_flatshort|DB_CHANGE]] allows you to modify the database data using the SQL language:
* Prepare your SQL query and use modify:
@@ -23,10 +23,10 @@ Use the [[ref:/libraries/store/reference/db_change_flatshort|DB_CHANGE]] class
session_control.commit
</code>
{{tip| '''Tip''': It is always better to check the database status for errors before committing changes. }}
{{tip|It is always better to check the database status for errors before committing changes. }}
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Data Object Coupling|Data storing]] <br/>
[[Stored Procedures|Stored procedures]] <br/>
[[EiffelStore Implementation Layer|Implementation]] <br/>

View File

@@ -19,7 +19,7 @@ A [[ref:/libraries/store/reference/db_repository_flatshort|DB_REPOSITORY]] obje
end
</code>
{{tip| '''Tip''': Loading a table description is often a costly operation: table has to be fetched among existing tables then every table column description must be loaded. Hence it is better to store and reuse a repository (maybe with a HASH_TABLE) once it has been loaded. }}
{{tip|Loading a table description is often a costly operation: table has to be fetched among existing tables then every table column description must be loaded. Hence it is better to store and reuse a repository (maybe with a HASH_TABLE) once it has been loaded. }}
Using the table information, [[ref:/libraries/store/reference/db_repository_flatshort|DB_REPOSITORY]] then helps generating Eiffel classes mapping relational tables:
* You can directly use {[[ref:/libraries/store/reference/db_repository_flatshort|DB_REPOSITORY]] }.generate_class. Generated class may look like:
@@ -40,7 +40,7 @@ Using the table information, [[ref:/libraries/store/reference/db_repository_flat
...
</code>
{{note| '''Note''': The EiffelStore Wizard uses the generation.generator cluster to generate the classes mapped to your database. }}
{{note|The EiffelStore Wizard uses the generation.generator cluster to generate the classes mapped to your database. }}
==Inserting data in the database==
@@ -79,10 +79,10 @@ This is straight-forward since you only have to give [[ref:/libraries/store/refe
end
</code>
{{note| '''Note''': You can see how actions are used in [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] . }}
{{note|You can see how actions are used in [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] . }}
<br/>
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database Selection|Performing a database selection.]] <br/>
[[Data structures use|Database-specific structures use.]] <br/>
}}

View File

@@ -11,11 +11,11 @@
</code>
<br/>
{{note| '''Note''': Calling set_base links the EiffelStore interface to this specific handle. }}
{{note|Calling set_base links the EiffelStore interface to this specific handle. }}
{{tip| '''Tip''': You can manage handles to many databases: as an instance of <eiffel>DATABASE_APPL</eiffel> stands for a specific database handle, you only have to create one instance of <eiffel>DATABASE_APPL</eiffel> for every DBMS handle you wish to create. Do not forget to call set_base to activate appropriate handle. }}
{{tip|You can manage handles to many databases: as an instance of <eiffel>DATABASE_APPL</eiffel> stands for a specific database handle, you only have to create one instance of <eiffel>DATABASE_APPL</eiffel> for every DBMS handle you wish to create. Do not forget to call set_base to activate appropriate handle. }}
{{note| '''Note''': The generic parameter of <eiffel>DATABASE_APPL</eiffel> specifies the actual DBMS used. }}
{{note|The generic parameter of <eiffel>DATABASE_APPL</eiffel> specifies the actual DBMS used. }}
# Once your handle is created, you have to create a session manager which will allow you to manage your database, specifically to establish connection, disconnect and also handle errors. The class <eiffel>DB_CONTROL</eiffel> enables your application to plainly control the functioning and status of your database and to request any information about it.
<code>
@@ -26,10 +26,10 @@
session_control.connect
</code>
{{note| '''Note''': Take a look at the [[Database control|database control]] part to see how to use <eiffel>DB_CONTROL</eiffel> capabilities. }}
{{note|Take a look at the [[Database control|database control]] part to see how to use <eiffel>DB_CONTROL</eiffel> capabilities. }}
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database control|Database control and error handling]] <br/>
[[EiffelStore Implementation Layer|Implementation]] <br/>
}}

View File

@@ -59,7 +59,7 @@ The loop performs a multi-step transaction. If transaction is not carried out en
{{warning| '''Caution''': Some databases can be in an auto-commit mode. Furthermore, some special database commands can automatically commit database changes. }}
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database Connection|Database connection]] <br/>
[[EiffelStore Implementation Layer|Implementation]] <br/>
}}

View File

@@ -3,7 +3,7 @@
[[Property:uuid|de759a74-b3e1-c937-e620-67526c116925]]
Use the [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] class to select data from the database. Once you have selected the data, you can [[Selection Access|access]] it with convenience using adaptative EiffelStore structures.
{{note| '''Note''': Take a look at the [[Data Object Coupling|Database/Eiffel objects Coupling]] if you need information about your database structure. }}
{{note|Take a look at the [[Data Object Coupling|Database/Eiffel objects Coupling]] if you need information about your database structure. }}
[[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] enables your application to get database content using SQL 'select' queries:
* You can carry out 'select' queries in an intuitive way using directly the SQL language:
@@ -15,11 +15,11 @@ Use the [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]]
selection.execute
</code>
{{tip| '''Tip''': Always check the database status for errors after your 'select' query. }}
{{tip|Always check the database status for errors after your 'select' query. }}
* You can also customize your selection using [[Query variables|bind variables]] .
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Query variables|Binding variables in a database query.]] <br/>
[[Data Object Coupling|Coupling database objects with Eiffel objects.]] <br/>
[[Selection Access|Accessing selected data from the database.]] <br/>

View File

@@ -13,9 +13,9 @@ The interface affords these main capabilities:
* Using [[Stored Procedures|stored procedures]] .
* Dealing with database [[Database control|status and behavior]] .
{{note| '''Note''': In general, each of these capabilities corresponds to one EiffelStore class. }}
{{note|In general, each of these capabilities corresponds to one EiffelStore class. }}
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[EiffelStore Implementation Layer|The implementation layer]] }}

View File

@@ -22,7 +22,7 @@ Variables syntax is simple: the ':' special character followed by the variable n
selection.set_query ("Select * from CONTACTS where Firstname = ':" + Bind_var + "'")
</code>
{{note| '''Note''': The code example shows how to bind variables to a [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] object but the mechanism is exactly the same for [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] objects. }}
{{note|The code example shows how to bind variables to a [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] object but the mechanism is exactly the same for [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] objects. }}
==Binding variables to a query==
@@ -40,7 +40,7 @@ Once you have created your query, you can map variable names to values and execu
end
</code>
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database Selection|Performing a database selection.]] <br/>
[[Data Modification|Modifying database content.]] <br/>
}}

View File

@@ -3,7 +3,7 @@
[[Property:uuid|3b4fdde3-d903-55c8-0068-cee2407db280]]
Once you have [[Database Selection|selected data]] from the database, it returns a set of rows containing queried columns values. Each row loaded with DB_SELECTION is stored in a DB_RESULT object. The easiest way to access the data is thus to refer to DB_RESULT objects themselves.
{{note| '''Note''': Take a look at the [[Data Object Coupling|Database/Eiffel objects Coupling]] to learn advanced data handling features. }}
{{note|Take a look at the [[Data Object Coupling|Database/Eiffel objects Coupling]] to learn advanced data handling features. }}
To use DB_RESULT, process in 2 steps:
* [[#retrieve|retrieve]] DB_RESULT objects.
@@ -41,7 +41,7 @@ To use DB_RESULT, process in 2 steps:
end
</code>
{{tip| '''Tip''': Provide [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] with the LIST structure convenient for what you need to do with the results. }}
{{tip|Provide [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] with the LIST structure convenient for what you need to do with the results. }}
* You want to '''select part''' of the result set: you can set an action in [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] that will be executed each time a row is loaded. This action can for instance manipulate current row and define a stop condition.
** You need to define a descendant of class ACTION and set it to [[ref:/libraries/store/reference/db_selection_flatshort|DB_SELECTION]] :
@@ -93,7 +93,7 @@ A DB_RESULT object merely carries data retrieved from the database. You have to
end
</code>
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database Selection|Performing a database selection.]] <br/>
[[Data Object Coupling|Coupling database data and Eiffel objects.]] <br/>
}}

View File

@@ -22,11 +22,11 @@ To execute a stored procedure:
</code>
* Execute the procedure through a [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] (if a result is expected) or a [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE ]] object (otherwise).
{{note| '''Note''': Requests with a result ([[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] ) or without ([[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] ) are both abstract '''expressions'''. DB_PROC executes an abstract expression using an object of [[ref:/libraries/store/reference/db_expression_chart|DB_EXPRESSION]] type, which corresponds to an abstract expression. [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] and [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] inherits from [[ref:/libraries/store/reference/db_expression_chart|DB_EXPRESSION]] . }}
{{note|Requests with a result ([[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] ) or without ([[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] ) are both abstract '''expressions'''. DB_PROC executes an abstract expression using an object of [[ref:/libraries/store/reference/db_expression_chart|DB_EXPRESSION]] type, which corresponds to an abstract expression. [[ref:/libraries/store/reference/db_selection_chart|DB_SELECTION]] and [[ref:/libraries/store/reference/db_change_chart|DB_CHANGE]] inherits from [[ref:/libraries/store/reference/db_expression_chart|DB_EXPRESSION]] . }}
You can execute your request mostly like a basic one:
** Create your request.
** Bind request variables. Variables are stored procedure arguments.
{{note| '''Note''': Take a look at how to [[Query variables|bind variables]] to a query. }}
{{note|Take a look at how to [[Query variables|bind variables]] to a query. }}
** Execute the query through the DB_PROC object.
<code>
@@ -62,7 +62,7 @@ The following example shows how to overwrite a procedure in the database:
end
</code>
{{seealso| '''See Also''' <br/>
{{seealso|<br/>
[[Database Selection|Performing a database selection.]] <br/>
[[Data Object Coupling|Coupling database data and Eiffel objects.]] <br/>
}}