-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CONTAINERNET-42] テーブル定義情報の取得に時間がかかる場合がある
git-svn-id: https://www.seasar.org/svn/s2dao.net/trunk@586 638a8f4c-ee01-0410-9780-f2e338a3b7db
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html><head><!-- don't edit start --><title>Seasar - DI Container with AOP -</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta http-equiv="Content-Style-Type" content="text/css"> | ||
<link href="seasar_b.css" type="text/css" rel="stylesheet" media="screen"><link href="seasar_p.css" type="text/css" rel="stylesheet" media="print"><script src="seasar_b.js" type="text/JavaScript" language="JavaScript"></script></head> | ||
<link rel="stylesheet" type="text/css" href="csharp.css" > | ||
|
||
<body onload="preload('ja')"><table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr> | ||
<td align="left" valign="top" width="780"><table class="white" border="0" cellpadding="0" cellspacing="0" width="780"> | ||
<tbody><tr><td colspan="7"><img src="images/top01_b.gif" alt="" height="5" width="780"></td></tr> | ||
<tr><td width="235"><img src="images/top02_b.gif" alt="Seasar" height="117" width="235"></td> | ||
<td colspan="3"><img src="images/top03.gif" alt="DI Container with AOP" height="117" width="289"></td> | ||
<td colspan="3"><img src="images/spacer.gif" alt="" height="117" width="256"></td> | ||
</tr><tr><td rowspan="2"><img src="images/top04.gif" alt="" height="49" width="235"></td> | ||
<td><a href="http://www.seasar.org/index.html"><img src="images/menu01_b_ja.gif" alt="" id="menu01" onmouseover="swap(1)" onmouseout="restore(1)" border="0" height="30" width="78"></a></td> | ||
<td><a href="http://www.seasar.org/projects.html"><img src="images/menu02_b_ja.gif" alt="" id="menu02" onmouseover="swap(2)" onmouseout="restore(2)" border="0" height="30" width="101"></a></td> | ||
|
||
<td><a href="http://www.seasar.org/products.html"><img src="images/menu03_b_ja.gif" alt="" id="menu03" onmouseover="swap(3)" onmouseout="restore(3)" border="0" height="30" width="110"></a></td> | ||
<td><a href="http://www.seasar.org/resources.html"><img src="images/menu04_b_ja.gif" alt="" id="menu04" onmouseover="swap(4)" onmouseout="restore(4)" border="0" height="30" width="113"></a></td> | ||
<td><img src="images/menu05_b_ja.gif" alt="" id="menu05" onmouseover="swap(5)" onmouseout="restore(5)" border="0" height="30" width="109"></td> | ||
<td width="34"><img src="images/menu06.gif" alt="" height="30" width="34"></td></tr><tr> | ||
<td colspan="6"><img src="images/spacer.gif" alt="" height="19" width="545"></td></tr></tbody></table> | ||
<table class="white" border="0" cellpadding="0" cellspacing="0" width="780"> | ||
<tbody><tr align="left" valign="top"><td width="18"><img src="images/spacer.gif" alt="" height="14" width="18"></td><td class="main" width="744"> | ||
<!-- don't edit end --> | ||
<!-- document start --> | ||
|
||
<a href="index.html">S2Dao.NET TOPページへ</a> | ||
|
||
<h1>S2Dao.NET - テーブル定義情報のキャッシュ</h1> | ||
|
||
<p>S2Dao.NETでは、Daoインターフェースの初期化時にデータベースからテーブル定義情報を取得しています。 | ||
テーブル定義情報の取得に時間がかかる場合、 | ||
テーブル定義情報をキャッシュするDataSetを参照することで取得時間の短縮が可能です。</p> | ||
|
||
<ul> | ||
<li><a href="#dataset">DataSetの作成</a></li> | ||
<li><a href="#dicon">Diconファイルの定義</a></li> | ||
</ul> | ||
|
||
<h2><a name="dataset">DataSetの作成</a></h2> | ||
|
||
<p>テーブル定義情報をキャッシュするDataSetは、Visual Studioのデザイナ画面を使用して作成することが可能です。 | ||
例えば、次の手順に従って作成します。</p> | ||
|
||
<ol> | ||
|
||
<li>Visual Studioのソリューション・エクスプローラからDataSetを作成するフォルダを選択し、 | ||
コンテキストメニューから「追加」→「新しい項目」を選択します。</li> | ||
|
||
<img src="images/cache_dataset1.png" align="left" /> | ||
<br clear="all"> | ||
|
||
<li>「新しい項目の追加」ダイアログを表示するのでテンプレート一覧から「データセット」を選択、 | ||
ファイル名にデータセットのファイル名を入力し、「追加」ボタンをクリックします。。</li> | ||
|
||
<li>DataSetがソリューション・エクスプローラに追加され、DataSetのデザイナ画面が表示されます。</li> | ||
|
||
<img src="images/cache_dataset2.png" align="left" /> | ||
<br clear="all"> | ||
|
||
<li>サーバー・エクスプローラからデータベースに接続します。</li> | ||
|
||
<img src="images/cache_dataset3.png" align="left" /> | ||
<br clear="all"> | ||
|
||
<li>テーブル一覧からS2Dao.NETで使用するテーブルをDataSetのデザイナ画面にドラッグ&ドロップします。</li> | ||
|
||
<img src="images/cache_dataset4.png" align="left" /> | ||
<br clear="all"> | ||
|
||
<li>DataSetのデザイナ画面を保存して終了します。</li> | ||
|
||
</ol> | ||
|
||
|
||
<h2><a name="dicon">Diconファイルの定義</a></h2> | ||
|
||
<p>テーブル定義情報のキャッシュを使用するために | ||
Dao.dicon(S2Dao.NETのコンポーネントを定義しているDiconファイル)を次のように変更します。</p> | ||
|
||
(変更前) | ||
<!-- code formatted by http://manoli.net/csharpformat/ --> | ||
<pre class="csharpcode"> | ||
<span class="kwrd"><</span><span class="html">components</span> <span class="attr">namespace</span><span class="kwrd">="Dao"</span><span class="kwrd">></span> | ||
.... | ||
|
||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Impl.FieldAnnotationReaderFactory"</span> <span class="kwrd">/></span> | ||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Impl.DaoMetaDataFactoryImpl"</span> <span class="kwrd">/></span> | ||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">name</span><span class="kwrd">="Interceptor"</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Interceptors.S2DaoInterceptor"</span> <span class="kwrd">/></span> | ||
<span class="kwrd"></</span><span class="html">components</span><span class="kwrd">></span></pre> | ||
|
||
(変更後) | ||
<!-- code formatted by http://manoli.net/csharpformat/ --> | ||
<pre class="csharpcode"> | ||
<span class="kwrd"><</span><span class="html">components</span> <span class="attr">namespace</span><span class="kwrd">="Dao"</span><span class="kwrd">></span> | ||
.... | ||
|
||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Impl.FieldAnnotationReaderFactory"</span> <span class="kwrd">/></span> | ||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Impl.DaoMetaDataFactoryImpl"</span><span class="kwrd">></span> | ||
<span class="kwrd"><</span><span class="html">property</span> <span class="attr">name</span><span class="kwrd">="DBMetaData"</span><span class="kwrd">></span> | ||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">class</span><span class="kwrd">="Seasar.Extension.ADO.Impl.DatabaseMetaDataImpl"</span><span class="kwrd">></span> | ||
<span class="kwrd"><</span><span class="html">property</span> <span class="attr">name</span><span class="kwrd">="MetaDataSetClassName"</span><span class="kwrd">></span>"Seasar.ContainerNet42.Dao.EmployeeDataSet"<span class="kwrd"></</span><span class="html">property</span><span class="kwrd">></span> | ||
<span class="kwrd"></</span><span class="html">component</span><span class="kwrd">></span> | ||
<span class="kwrd"></</span><span class="html">property</span><span class="kwrd">></span> | ||
<span class="kwrd"></</span><span class="html">component</span><span class="kwrd">></span> | ||
<span class="kwrd"><</span><span class="html">component</span> <span class="attr">name</span><span class="kwrd">="Interceptor"</span> <span class="attr">class</span><span class="kwrd">="Seasar.Dao.Interceptors.S2DaoInterceptor"</span> <span class="kwrd">/></span> | ||
<span class="kwrd"></</span><span class="html">components</span><span class="kwrd">></span></pre> | ||
|
||
<p>Seasar.Extension.ADO.Impl.DatabaseMetaDataImplクラスのMetaDataSetClassNameプロパティに<a href="#dataset">DataSetの作成</a>で作成した | ||
DataSetクラスの名前空間+クラス名を設定します。名前空間+クラス名は、[DataSet].Designer.csから確認できます。 | ||
</p> | ||
|
||
<!-- document end --> | ||
<!-- don't edit start --> | ||
</td> | ||
<td width="14"><img src="images/spacer.gif" alt="" height="14" width="14"></td> | ||
</tr><tr> | ||
<td width="14"><img src="images/spacer.gif" alt="" height="30" width="14"></td> | ||
<td width="766"><img src="images/spacer.gif" alt="" height="30" width="592"></td> | ||
</tr><tr> | ||
<td width="14"><img src="images/spacer.gif" alt="" height="14" width="14"></td> | ||
<td class="copyright" width="766">© Copyright The Seasar Project and the others 2004-2008, all rights reserved.</td> | ||
|
||
</tr></tbody></table> | ||
</td><td class="backright" align="left" valign="top"> </td></tr><tr> | ||
<td class="backunder" align="left" height="16" valign="top" width="780"> </td> | ||
<td class="backcorner" align="left" height="16" valign="top"> </td> | ||
</tr></tbody></table><!-- don't edit end --> | ||
</body></html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters