thrift.mongo.bug

.thrift中定義類:

include ‘fare.thrift’

typedef fare.Rule Rule

struct TzRule {

1:optional Rule rule, 

}

在mongo數據庫中存入TzRule類的時候會報錯

應該寫成:

struct TzRule {

1:optional fare.Rule rule, 

}

http://diwakergupta.github.io/thrift-missing-guide/

Typedefs

The Java language does not have any native support for "typedefs". So when the Thrit Java code generator encounters a typedef declaration, it merely substitutes it with the original type. That is, even though you may have typedefd TypeA to TypeB, in the generated Java code, all references to TypeB will be replaced by TypeA.

Consider the example IDL above. The declaration for tweets in the generated code for TweetSearchResults is simply public List<Tweets> tweets.



此外mongo+jetty也有錯誤,最好用tomcat

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章