开发者

Apache Taste String Id

Is it possible to use an id which isn't an integer using taste?

My model may have preferences for remote products. To differentiate these we use a string identifier which is "locationId:itemId". I can't see support fo开发者_如何学Cr this however.

Is there any other way to get around this?


Yes, though it's going to slow things down. Look at IDMigrator and implementations and usages in the framework. This is how you can get some help in translating to/from integer IDs automatically.

There is no support for this in the distributed version.


Yes. Look at the answers to this question. Basically you can extend FileDataModel, overriding readItemIDFromString(String stringID), and perhaps use an IDMigrator to do the conversion.


userId and itemId can be string, so this is the CustomFileDataModel which will convert your string into integer and will keep the map (String,Id) in memory; after recommendations you can get string from id.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜