Spring-data1.0.0.M3とMongoDB。どうして春はこのクラスをマッピングできるのでしょうか。
import org.springframework.data.document.mongodb.index.IndexDirection;
import org.springframework.data.document.mongodb.mapping.Document;
@Document
public class EnumsMapper {
private IndexDirection d = IndexDirection.ASCENDING;
}
そしてこれで失敗します:
import org.springframework.data.document.mongodb.index.IndexDirection;
import org.springframework.data.document.mongodb.mapping.Document;
import java.util.List;
import java.util.Arrays;
@Document
public class EnumsMapper {
List<IndexDirection> list_enum_test = Arrays.asList(
new IndexDirection[] {IndexDirection.ASCENDING});
}
とともに:
java.lang.IllegalArgumentException: can't serialize class org.springframework.data.document.mongodb.index.IndexDirection
同じことが他のコレクション(セット、...)や配列でも起こります。明らかに、春はこの列挙型をマップできるので、マッパーを作成しても問題は解決しません。これはバグですか、それとも列挙型を保持するコレクション(セット/マップ)をマップする方法がありますか?