开发者

Hibernate querying results format

I have a web service that provides queries functionality using hibernate. A query can return mult开发者_StackOverflow社区iple results - each results contains multiple parameters.

The question is: how should I return the result:

  1. Can serialize everything into 1 string nd client will parse it.
  2. I know there is a possibility to return Array of strings or Array of complex types.

Which is better for performance - there might be lots of user doing request etc.

If better using the complex types - can give an example of using it - or a link to some info.

Thanks Yoav


Web services generally return results in a platform-independent, but structured way. XML and JSON are two frequent choices.

There are plenty of apis in Java to generate XML and JSON. Google for them. I like using JAXB for XML. Some APIs take JAXB-annotated objects and serialize them into JSON instead of XML.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜