Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide
In directory sc8-pr-cvs1:/tmp/cvs-serv18100/doc/UserGuide
Modified Files:
DefiningaModel.tex
Log Message:
Fixed typos and added TEXT in the list of supported sql datatypes
Index: DefiningaModel.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide/DefiningaModel.tex,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DefiningaModel.tex 27 May 2003 19:12:18 -0000 1.9
--- DefiningaModel.tex 31 May 2003 15:13:39 -0000 1.10
***************
*** 356,360 ****
identify every row of a table. It is {\bf required} that a non-abstract
Entity\footnote{abstract entities are not supported yet} defines one of its
! entities to be a primary key. Within the \code{<entity>} tag you define
attributes, relationships, and primary keys as well as the attributes that
are ''used for locking'' (this we will not explained for now, as it
--- 356,360 ----
identify every row of a table. It is {\bf required} that a non-abstract
Entity\footnote{abstract entities are not supported yet} defines one of its
! attributes to be a primary key. Within the \code{<entity>} tag you define
attributes, relationships, and primary keys as well as the attributes that
are ''used for locking'' (this we will not explained for now, as it
***************
*** 419,423 ****
% \module{mxDateTime}). While this is not (yet) checked, you should keep
the externalType and the python type in sync (python \code{string}:
! SQL \code{CHAR} or \code{VARCHAR}, \code{int}: SQL \code{INTEGER},
etc.)
--- 419,424 ----
% \module{mxDateTime}). While this is not (yet) checked, you should keep
the externalType and the python type in sync (python \code{string}:
! SQL \code{CHAR}, \code{VARCHAR} or \code{TEXT}\footnote{if you
! db-server supports \code{TEXT}}, \code{int}: SQL \code{INTEGER},
etc.)
***************
*** 442,447 ****
mapped. Supported SQL types are: \code{INTEGER}/\code{INT},
\code{CHAR}/\code{VARCHAR} (requires a \code{width}, see below),
\code{NUMERIC} (requires \code{precision} and \code{scale}, see
! below), \code{TIMESTAMP} and \date{DATETIME}.
\item[\code{precision}, \code{scale}, \code{width}:]
--- 443,449 ----
mapped. Supported SQL types are: \code{INTEGER}/\code{INT},
\code{CHAR}/\code{VARCHAR} (requires a \code{width}, see below),
+ \code{TEXT},
\code{NUMERIC} (requires \code{precision} and \code{scale}, see
! below), \code{TIMESTAMP} and \code{DATETIME}.
\item[\code{precision}, \code{scale}, \code{width}:]
***************
*** 453,456 ****
--- 455,475 ----
Default value: \code{'0'}.
+ \begin{notice} The field \code{width} is used at runtime when
+ validating a string attribute's value
+ (see~\ref{customobject-validation}, ``Validation''), before objects
+ are saved in the database. SQL data types \code{CHAR} and
+ \code{VARCHAR} require that \code{width} is specified; on the other
+ hand, \code{TEXT} --when supported by the database-- does not accept
+ that width is set. If you set it on an attribute, it will be
+ ignored when the database schema is generated (i.e. a \code{TEXT}
+ field my_text with width=30 won't be declared as \code{TEXT(30)},
+ but simply as \code{TEXT}), but it will be checked at runtime and
+ validation for this attribute will fail if its value's length
+ exceeds the given width. Note that the same goal can be achieved by
+ writing a specific validation method for the attribute
+ (see~\ref{customobject-validation-by-key}).
+
+ \end{notice}
+
\item[\code{defaultValue}:] use this field to assign a default
value to the class' attribute. Note that this is only used when python
***************
*** 563,568 ****
The exact definition of to-one and to-many relationships
(see~\ref{model-concepts}) are then: to-one relationship:
! \code{multiplicityUpperBound}$<=1$, to-many relationship:
! \code{multiplicityUpperBound}$>1$.
\item[\code{destinationEntity}:] designates the name of the destination
--- 582,587 ----
The exact definition of to-one and to-many relationships
(see~\ref{model-concepts}) are then: to-one relationship:
! \code{multiplicityUpperBound<=1}, to-many relationship:
! \code{multiplicityUpperBound>1}.
\item[\code{destinationEntity}:] designates the name of the destination
***************
*** 978,982 ****
\end{itemize}
! Running each of the above scripts with \code{--help} will give further details.
--- 997,1001 ----
\end{itemize}
! Running each of the above scripts with \verb+--help+ will give further details.
|