亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fastdb.htm

?? 俄羅斯牛人KK的作品,著名的ORDBMS,這里上傳最新的3.39版本源代碼.希望了解對象關系數據庫的同好,請不要錯過.
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
The method should be a parameterless instance member function
returning a
boolean, numeric, reference or string type. Methods should be specified after 
all other attributes of the class. 
</DL><P>

Although only atomic fields can be indexed, an index type can be specified 
for structures. The index will be created for components of the structure
only if such type of index is specified in the index type mask of the 
structure. This allows the programmers to enable or disable indices for 
structure fields depending on the role of the structure in the record.<P>

The following example illustrates the creation of a type descriptor 
in the header file:<P>

<PRE>
class dbDateTime { 
    int4 stamp;
  public:
 
    int year() { 
	return localtime((time_t*)&stamp)-&gt;tm_year + 1900;
    }
    ...

    CLASS_DESCRIPTOR(dbDateTime, 
		     (KEY(stamp,INDEXED|HASHED), 
		      METHOD(year), METHOD(month), METHOD(day),
		      METHOD(dayOfYear), METHOD(dayOfWeek),
		      METHOD(hour), METHOD(minute), METHOD(second)));
};    

class Detail { 
  public:
    char const* name;
    char const* material;
    char const* color;
    real4       weight;

    dbArray&lt; dbReference&lt;Contract&gt; &gt; contracts;

    TYPE_DESCRIPTOR((KEY(name, INDEXED|HASHED), 
		     KEY(material, HASHED), 
		     KEY(color, HASHED),
		     KEY(weight, INDEXED),
		     RELATION(contracts, detail)));
};

class Contract { 
  public:
    dbDateTime            delivery;
    int4                  quantity;
    int8                  price;
    dbReference&lt;Detail&gt;   detail;
    dbReference&lt;Supplier&gt; supplier;

    TYPE_DESCRIPTOR((KEY(delivery, HASHED|INDEXED), 
		     KEY(quantity, INDEXED), 
		     KEY(price, INDEXED),
		     RELATION(detail, contracts),
		     RELATION(supplier, contracts)));
};
</PRE>

Type descriptors should be defined for all classes used in the database.
In addition to defining type descriptors, it is necessary to establish
a mapping between C++ classes and database tables. The macro 
<code>REGISTER(</code>name<code>)</code> will do it. Unlike the
<code>TYPE_DESCRIPTOR</code> macro, the <code>REGISTER</code> macro should
be used in the implementation file and not in the header file. It constructs
a descriptor of the table associated with the class. If you are going to work
with multiple databases from one application, it is possible to register
a table in a concrete database by means of the
<code>REGISTER_IN(</code>name,database</code<code>)</code> macro. 
The parameter <code>database</code> of this macro should be a pointer to the
<code>dbDatabase</code> object. You can register tables
in the database as follows:<P>

<PRE>
REGISTER(Detail);
REGISTER(Supplier);
REGISTER(Contract);
</PRE>

The table (and correspondent class) can be used only with one database 
at each moment of time. When you open a database, FastDB imports into
the database all classes defined in the application.
If a class with the same name already exists 
in the database, its descriptor stored in the database is compared with the
descriptor of this class in the application. If the class definitions
differ, FastDB tries to convert records from the table to the new 
format. Any kind of conversion between numeric types (integer to
real, real to integer, with extension or truncation) is allowed. Also,
addition of new fields can be easily handled. But removal of fields
is only possible for empty tables (to avoid accidental data destruction).<P>

After loading all class descriptors, FastDB checks if all indices specified 
in the application class descriptor are already present in the database, 
constructs new indices and
removes indices, which are no more used. Reformatting the table and 
adding/removing indices is only possible when no more than one
application accesses the database. So when the first application is attached
to the database, it can perform table conversion. All other applications
can only add new classes to the database.<P>

There is one special internal database  <code>Metatable</code>, which
contains information about other tables in the database. C++ programmers
need not access this table, because the format of database tables is specified
by C++ classes. But in an interactive SQL program, it may be necessary to
examine this table to get information about record fields.<P>

Starting from version 2.30 FastDB supports autoincrement fields
(fields unique value to which are assigned automaticaly by database).
To be able to use them you should:<P>

<OL>
<LI>Recompile FastDB and your application with <code>-DAUTOINCREMENT_SUPPROT</code> flags 
(add this flag to <code>DEFS</code> variables in FastDB makefile).<BR>
<B>Attention</B>: database files created by FastDB compiled without this option will be incompatible 
with FastDB compiled with <code>DAUTOINCREMENT_SUPPORT</code>.

<LI>If you want to use other than 0 initial counter value, you should
asssign value to <code>dbTableDescriptor::initialAutoincrementCount</code>.
It will be shared between all tables, so all table will have the same initial value of 
autoincrement counter.

<LI>Autoincrement fields should be of int4 type and should be declared
with <code>AUTOINCREMENT</code> flag:

<PRE>
        class Record {
             int4 rid;
             char const* name;
             ...
       
             TYPE_DESCRIPTOR((KEY(rid, AUTOINCREMENT|INDEXED), FIELD(name), ...));
       }
</PRE>       
       
<LI>When record with autoincrement field is inserted in the database
there is no need to specify value of autoincremented field (it will be
ignored). After successful insertion of record this field will be
assigned unique value (which is guaranteed to be not used before this
table):

<PRE>
       Record rec;
       // no rec.rid should be specified
       rec.name = "John Smith";
       insert(rec);
       // rec.rid now assigned unique value
       int newRecordId  = rec.rid; // and can be used to reference this record
</PRE>

<LI>When record is removed the value will not be reused.
When transaction is aborted, table autoincrement counter is also rolled back.
</OL><P>


<H3><A NAME = "query">Query</A></H3>
The class query is used to serve two purposes: 

<OL>
<LI>to construct a query and bind query parameters
<LI>to cache compiled queries
</OL>

FastDB provides overloaded '<code>=</code>' and '<code>,</code>' C++ operators
to construct query statements with parameters. Parameters can be specified  
directly in places where they are used, eliminating any mapping between
parameter placeholders and C variables. In the following sample query,
pointers to the parameters <code>price</code> and <code>quantity</code> 
are stored in the query, so that the query can be executed several times
with different parameter values. C++ overloaded functions make it possible
to automatically determine the type of the parameter, 
requiring no extra information
to be supplied by the programmer (such reducing the possibility of a bug). 

<PRE>
        dbQuery q;
        int price, quantity;
        q = "price >=",price,"or quantity >=",quantity;
</PRE> 

Since the  <code>char*</code> type can be used both for specifying a fraction
of a query (such as "price >=") and for a parameter of string type,
FastDB uses a special rule to resolve this ambiguity. This rule is based on the
assumption that there is no reason for splitting a query text into two strings
like ("price ",">=") or specifying more than one parameter sequentially
("color=",color,color). So FastDB assumes the first string to be a fraction
of the query text and switches to <I>operand mode</I>
after it. In <I>operand mode</I>, FastDB treats the <code>char*</code> argument
as a query parameter and switches back to query <I>text mode</I>, and so on...
It is also possible not to use this "syntax sugar" and construct
query elements explicitly by the 
<code>dbQuery::append(dbQueryElement::ElementType type, void const* ptr)</code>
method. Before appending elements to the query,
it is necessary to reset the query by the <code>dbQuery::reset()</code> method
('<code>operator=</code>' does it automatically).<P>

It is not possible to use C++ numeric constants as query parameters, because
parameters are accessed by reference. But it is possible to use string
constants, because strings are passed by value. There two possible ways of 
specifying string parameters in a query: using a string buffer or a
pointer to pointer to string:<P>

<PRE>
     dbQuery q;
     char* type;
     char name[256];
     q = "name=",name,"and type=",&type;

     scanf("%s", name);
     type = "A";     
     cursor.select(q);
     ...
     scanf("%s", name);
     type = "B";     
     cursor.select(q);
     ...
</PRE><P>


Query variables can neither be passed to a function as a parameter
nor be assigned to another variable.
When FastDB compiles the query, it saves the compiled tree in this object. 
The next time the query will be used, 
no compilation is needed and the already compiled
tree can be used. It saves some time needed for query compilation.<P>

FastDB provides two approaches to integrate user-defined types in databases.
The first - the definition of class methods - was already mentioned. 
The other approach deals only with query construction. Programmers should
define methods, which will not do actual calculations, but instead
return an expression (in terms of predefined database types), which
performs the necessary calculation. It is better to describe it by example.
FastDB has no builtin datetime type. Instead of this, a normal C++
class <code>dbDateTime</code> can be used by the programmer. This class defines
methods allowing to specify datetime fields in ordered lists and
to compare two dates using normal relational operators:<P>

<PRE>
class dbDateTime { 
    int4 stamp;
  public:
    ...
    dbQueryExpression operator == (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"=",stamp;
	return expr;
    }
    dbQueryExpression operator != (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<>",stamp;
	return expr;
    }
    dbQueryExpression operator &lt; (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),">",stamp;
	return expr;
    }
    dbQueryExpression operator &lt;= (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),">=",stamp;
	return expr;
    }
    dbQueryExpression operator &gt; (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<",stamp;
	return expr;
    }
    dbQueryExpression operator &gt;= (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<=",stamp;
	return expr;
    }
    friend dbQueryExpression between(char const* field, dbDateTime& from,
				     dbDateTime& till)
    { 
	dbQueryExpression expr;
	expr=dbComponent(field,"stamp"),"between",from.stamp,"and",till.stamp;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡高清视频| 欧美日本在线播放| 欧美精品久久天天躁| 欧美高清在线视频| 日本不卡一区二区三区| 99久久99精品久久久久久 | 韩国精品在线观看| 91福利在线免费观看| 国产日韩欧美综合在线| 蜜乳av一区二区| 欧美精品一级二级| 亚洲综合久久久久| 99久久精品久久久久久清纯| 国产无一区二区| 国产一区二区视频在线| 日韩限制级电影在线观看| 一个色综合av| 色综合亚洲欧洲| 中文字幕一区二区三区乱码在线| 美女任你摸久久| 欧美日韩亚州综合| 亚洲在线视频网站| 欧美性色黄大片手机版| 一级女性全黄久久生活片免费| 99精品视频在线观看免费| 国产视频视频一区| 成人精品在线视频观看| 中文字幕不卡三区| av网站一区二区三区| 中文字幕第一页久久| 波多野结衣视频一区| 国产精品的网站| 色偷偷久久人人79超碰人人澡 | 久久久久国产成人精品亚洲午夜| 日韩成人精品在线观看| 91精品国产乱| 久久精品国产一区二区三区免费看 | 日韩丝袜美女视频| 老鸭窝一区二区久久精品| 欧美一卡2卡3卡4卡| 麻豆91在线观看| 精品免费日韩av| 国产高清亚洲一区| 一区视频在线播放| 欧美色手机在线观看| 日本在线不卡一区| www国产成人免费观看视频 深夜成人网 | 懂色中文一区二区在线播放| 国产日韩成人精品| 色综合天天综合狠狠| 一区二区免费在线播放| 91在线精品秘密一区二区| 国产三级欧美三级日产三级99| 成人动漫中文字幕| 亚洲视频一区在线| 欧美网站一区二区| 国模一区二区三区白浆| 国产欧美日韩三区| 91麻豆文化传媒在线观看| 亚洲成av人片在线观看无码| 26uuu色噜噜精品一区二区| 不卡视频在线看| 午夜精品久久久久久久99樱桃| 日韩欧美精品三级| 91蜜桃传媒精品久久久一区二区| 亚洲午夜在线电影| 久久这里只有精品首页| 欧洲人成人精品| 狠狠色丁香久久婷婷综合丁香| 国产精品久久影院| 91精品国产高清一区二区三区蜜臀 | 欧美日韩中字一区| 国产乱码精品一区二区三| 亚洲精品高清在线观看| 精品国产一二三| 欧美午夜宅男影院| 大白屁股一区二区视频| 偷拍亚洲欧洲综合| 亚洲天堂精品在线观看| 久久亚洲综合色一区二区三区| 91国模大尺度私拍在线视频| 国产麻豆一精品一av一免费| 亚洲午夜视频在线观看| 国产精品福利一区| 久久影院午夜片一区| 91精品久久久久久久99蜜桃| 91蝌蚪porny| 国产成人精品亚洲日本在线桃色| 日韩中文字幕一区二区三区| 1000部国产精品成人观看| 欧美大片国产精品| 欧美理论片在线| 欧美亚洲综合久久| 99久久亚洲一区二区三区青草| 麻豆成人av在线| 日韩电影在线免费| 亚洲综合免费观看高清完整版在线| 国产日韩欧美高清| 精品久久久久久久久久久院品网| 欧洲在线/亚洲| 91小视频免费看| 成人的网站免费观看| 国产剧情一区二区| 经典三级在线一区| 国内外成人在线| 激情文学综合插| 精久久久久久久久久久| 美日韩一区二区三区| 奇米四色…亚洲| 久热成人在线视频| 国内精品视频666| 经典一区二区三区| 国产一区二区三区免费播放 | wwwwww.欧美系列| 日韩三级视频在线看| 欧美成人女星排行榜| 欧美精品一区二区三区在线 | 成人午夜视频网站| 成人精品电影在线观看| 成人av影视在线观看| 国产精品88av| 国产成人aaaa| 97久久超碰国产精品| 一本久久综合亚洲鲁鲁五月天| 91久久一区二区| 欧美高清视频一二三区| 日韩欧美久久久| 欧美激情中文字幕| 一区二区不卡在线播放 | 国产999精品久久| 成人晚上爱看视频| 色综合久久久久综合| 欧美日韩在线亚洲一区蜜芽| 91精品国产综合久久久久久久| 欧美大片一区二区| 中文字幕永久在线不卡| 亚洲永久精品国产| 精品一区二区三区视频在线观看| 国产丶欧美丶日本不卡视频| 一本色道a无线码一区v| 欧美一级黄色片| 国产免费成人在线视频| 亚洲激情欧美激情| 国产一区二区三区免费播放| 99精品久久免费看蜜臀剧情介绍| 在线精品观看国产| 日韩精品一区二区三区在线观看| 中文乱码免费一区二区| 亚洲va国产va欧美va观看| 国内不卡的二区三区中文字幕| 99久久99久久精品免费看蜜桃| 欧美人动与zoxxxx乱| 国产亚洲精品aa| 亚洲va欧美va国产va天堂影院| 国产在线看一区| 色婷婷狠狠综合| 久久久国产午夜精品| 亚洲不卡在线观看| 99在线热播精品免费| 91精品国产综合久久福利| 国产精品卡一卡二卡三| 美女在线视频一区| 欧美性大战xxxxx久久久| 中文字幕va一区二区三区| 免费在线观看精品| 在线亚洲+欧美+日本专区| 国产欧美日韩另类视频免费观看| 日产欧产美韩系列久久99| av午夜精品一区二区三区| 欧美精品一区二区三区四区| 一区二区三区在线观看动漫| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 337p亚洲精品色噜噜狠狠| 亚洲欧美在线aaa| 国产精品一区免费在线观看| 欧美人动与zoxxxx乱| 一区二区成人在线| av在线综合网| 欧美极品少妇xxxxⅹ高跟鞋| 老司机一区二区| 欧美久久久久久久久中文字幕| 亚洲日本va午夜在线影院| 国产精品一区二区视频| 欧美不卡一二三| 另类人妖一区二区av| 欧美人与禽zozo性伦| 亚洲国产日韩av| 欧美日韩一区二区三区免费看| 亚洲欧洲日韩女同| 91偷拍与自偷拍精品| 国产精品乱子久久久久| 国产福利精品一区| 国产人伦精品一区二区| 国产成人免费视频网站| 国产欧美在线观看一区| 成人爱爱电影网址| 中文字幕视频一区二区三区久| voyeur盗摄精品| 亚洲精选一二三| 色综合色狠狠天天综合色|