Exposing Hibernate criteria via service API

前端 未结 6 1150
鱼传尺愫
鱼传尺愫 2021-02-04 14:14

This is more of a design than implementation question and it\'s going to be long so bear with me. It\'s best explained with an example:

Let\'s say I have a business

6条回答
  •  梦谈多话
    2021-02-04 14:56

    Hmm - interesting question.

    Having thought it over, writing you own criteria interface is probably the way to go. It won't tie you to an implementation and will lower the security concerns.

    Also depending on how many objects are involved have considered returning the whole set of products (with necessary filters applied) then having the end user apply filters with lambdaj or similar. See:

    http://code.google.com/p/lambdaj/

提交回复
热议问题