[seasar-dotnet:340] Re: [S2Dao] 複数テーブルとの1:Nマッピングエラーについて
Kazuya Sugimoto
sugimotokazuya @ gmail.com
2006年 9月 18日 (月) 11:40:14 JST
杉本です。
こちらでTestA, TestB, TestCという3つのテーブルを作成して、同じ条件で
動作させてみたのですが問題ありませんでした。
何か問題が発生するための条件が漏れているのかもしれません。
log4netに出力されているSQLはどうなっているでしょうか?
長くなりますが以下にこちらでテストしたコードを載せておきます。
C#なのでVBのソースが必要な場合は、言ってください。
public class TestA
{
private TestB _testB;
private TestC _testC;
[Relno(0), Relkeys("Key1:Key1,Key2:KeyB")]
public TestB TB
{
set { _testB = value; }
get { return _testB; }
}
[Relno(1), Relkeys("Key1:Key1,Key3:KeyC")]
public TestC TC
{
set { _testC = value; }
get { return _testC; }
}
}
public class TestB
{
private int _key1;
private int _keyB;
public int Key1
{
set { _key1 = value; }
get { return _key1; }
}
public int KeyB
{
set { _keyB = value; }
get { return _keyB; }
}
}
public class TestC
{
private int _key1;
private int _keyC;
public int Key1
{
set { _key1 = value; }
get { return _key1; }
}
public int KeyC
{
set { _keyC = value; }
get { return _keyC; }
}
}
[Bean(typeof(TestA))]
public interface ITestADao
{
TestA[] GetAll();
}
--
Kazuya Sugimoto
http://d.hatena.ne.jp/sugimotokazuya/
seasar-dotnet メーリングリストの案内