2
spring-data 1.0.0.M3をMongoDBでマップする方法。どのように春が来て、このクラスをマッピングすることができます。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;
}
と、この1で失敗しますと
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
同じことが他のコレクション(セットで起こります... )、および配列。明らかにspringはこの列挙をマップすることができるので、マッパーを作成しても問題は解決しません。これはバグですか、あるいはenumを持つコレクション(set/map)をマップする方法がありますか?
リンクが壊れています... – slim