1

ActiveJDBCの使用は非常に制限されているようです

私は3つのテーブルa、b、cを持っています。それらにはすべてテキスト列があり、これらすべてのテーブルの結合が必要です

私は試した

LazyList<A> list = A.findBySQL("(select name as text from a) union (select version as text from b) union (select id as text from c)

そして私は試しました

LazyList<A> list = A.findBySQL("select a.* from ((select name as text from a) union (select version as text from b) union (select id as text from c)) as a");

どちらも機能しませんでした。これら 3 つのテーブルの結合を取得する他の方法はありますか?

4

2 に答える 2

1

ここでも同じ問題があります。私の解決策は次のとおりです。

String query = "select a.* from ((select name as text from a) union (select version as text from b) union (select id as text from c)) as a"; List<Map> result = new DB("default").all(query);

于 2016-07-16T23:54:54.077 に答える