From aa060c73be6177ef8720e75fef15d3ca72e3d042 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Mar 2011 12:22:15 +0200 Subject: Divide manual into multiple parts Change Chapter 10 to Part II and make the MySQL Database section into a chapter. Also add page breaks after each chapter. --- doc/manual.xhtml | 90 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 25 deletions(-) diff --git a/doc/manual.xhtml b/doc/manual.xhtml index f244dc5..41af7f8 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -62,6 +62,16 @@ for consistency. padding-top : 0.8em; } + /* Force page break for both PDF and HTML (when printing). */ + hr.page-break { + height: 0; + width: 0; + border: 0; + visibility: hidden; + + page-break-after: always; + } + /* Adjust indentation for three levels. */ #container { max-width: 48em; @@ -261,6 +271,7 @@ for consistency. PostScript.

+

Table of Contents

@@ -274,6 +285,10 @@ for consistency. + + + +
PART I OBJECT-RELATIONAL MAPPING
1Introduction @@ -444,18 +459,16 @@ for consistency. - + + + + @@ -463,6 +476,7 @@ for consistency.
1.1Architecture and Workflow
10Database Systems + PART II DATABASE SYSTEMS
10MySQL Database - - - + + + +
10.1MySQL Database - - - - - -
10.1.1MySQL Type Mapping
10.1.2MySQL Database Class
10.1.3Connection Factory
10.1.4MySQL Exceptions
-
10.1MySQL Type Mapping
10.2MySQL Database Class
10.3Connection Factory
10.4MySQL Exceptions
+

Preface

As more critical aspects of our lives become dependant on software @@ -552,9 +566,22 @@ for consistency. + + + +


+

PART I   + OBJECT-RELATIONAL MAPPING

+ +

Part I describes the essential database concepts, APIs, and tools that + together comprise the object-relational mapping for C++ as implemented + by ODB.

+ + +

1 Introduction

ODB is an object-relational mapping (ORM) system for C++. It provides @@ -759,6 +786,7 @@ for consistency. +


2 Hello World Example

In this chapter we will show how to create a simple C++ @@ -1158,7 +1186,7 @@ main (int argc, char* argv[]) database name, etc., from the command line. In your own applications you may prefer to use other mysql::database constructors which allow you to pass this information directly - (Section 10.1.2, "MySQL Database Class").

+ (Section 10.2, "MySQL Database Class").

Next, we create three person objects. Right now they are transient objects, which means that if we terminate the application @@ -1570,6 +1598,7 @@ Hello, Joe! +


3 Working with Persistent Objects

The previous chapters gave us a high-level overview of ODB and @@ -1920,7 +1949,7 @@ auto_ptr<odb::database> db ( as well as the next chapter which is dedicated to the topic of querying the database for persistent objects. For details on the system-specific database classes, refer to - Chapter 10, "Database Systems".

+ Part II, "Database Systems".

Before we can persist our objects, the corresponding database schema has to be created in the database. The schema contains table definitions and @@ -2756,8 +2785,8 @@ namespace odb

The database_exception exception is a base class for all database system-specific exceptions that are thrown by the - database system-specific runtime library. See Chapter - 10, "Database Systems" for more information.

+ database system-specific runtime library. Refer to Part + II, "Database Systems" for more information.

The unknown_schema exception is thrown by the odb::schema_catalog class if a schema with the specified @@ -2779,6 +2808,7 @@ namespace odb +


4 Querying the Database

If we don't know the identifiers of the objects that we are looking @@ -3317,6 +3347,7 @@ namespace odb +


5 Containers

The ODB runtime library provides built-in persistence support for @@ -3659,6 +3690,7 @@ private: +


6 Relationships

Relationships between persistent objects are expressed with pointers or @@ -4655,6 +4687,7 @@ t.commit (); +


7 Composite Value Types

A composite value type is a class or struct @@ -4976,6 +5009,7 @@ CREATE TABLE `person_nickname` ( +


8 Session

A session is an application's unit of work that may encompass several @@ -5165,6 +5199,7 @@ t.commit (); +


5 ODB Pragma Language

As we have already seen in previous chapters, ODB uses a pragma-based @@ -5535,7 +5570,7 @@ private: types, such as bool, int, and std::string and the database types for each supported database system. For more information on the default mapping, - refer to Chapter 10, "Database Systems".

+ refer to Part II, "Database Systems".

In the above example we changed the mapping for the bool type which is now mapped to the INT database type. In @@ -6379,19 +6414,24 @@ aCC +W2161 ... - + -

10 Database Systems

+
+

PART II   + DATABASE SYSTEMS

-

This chapter covers topics specific to the database system +

Part II covers topics specific to the database system implementations and their support in ODB. In particular, it describes the system-specific database classes as well as the default mapping between basic C++ value types and native database types.

+ + -

10.1 MySQL Database

+
+

10 MySQL Database

To generate support code for the MySQL database you will need to pass the "--database mysql" @@ -6400,7 +6440,7 @@ aCC +W2161 ... library (libodb-mysql). All MySQL-specific ODB classes are defined in the odb::mysql namespace.

-

10.1.1 MySQL Type Mapping

+

10.1 MySQL Type Mapping

The following table summarizes the default mapping between basic C++ value types and MySQL database types. This mapping can be @@ -6498,7 +6538,7 @@ aCC +W2161 ... to VARCHAR(255) NOT NULL MySQL type. Otherwise, it is mapped to TEXT NOT NULL.

-

10.1.2 MySQL Database Class

+

10.2 MySQL Database Class

The MySQL database class has the following interface:

@@ -6637,7 +6677,7 @@ namespace odb

This constructor throws the odb::mysql::cli_exception exception if the MySQL option values are missing or invalid. - See section Section 10.1.4, "MySQL Exceptions" + See section Section 10.4, "MySQL Exceptions" for more information on this exception.

The static print_usage() function prints the list of options @@ -6661,7 +6701,7 @@ namespace odb handle, refer to the MySQL ODB runtime source code for the interface of the connection class.

-

10.1.3 Connection Factory

+

10.3 Connection Factory

The connection_factory abstract class has the following interface:

@@ -6786,7 +6826,7 @@ main (int argc, char* argv[]) } -

10.1.4 MySQL Exceptions

+

10.4 MySQL Exceptions

The MySQL ODB runtime library defines the following MySQL-specific exceptions:

-- cgit v1.1