Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1FB4DFE0 for ; Thu, 13 Dec 2012 19:30:15 +0000 (UTC) Received: (qmail 74861 invoked by uid 500); 13 Dec 2012 19:30:15 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 74803 invoked by uid 500); 13 Dec 2012 19:30:15 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 74793 invoked by uid 99); 13 Dec 2012 19:30:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 19:30:15 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of min.chen@citrix.com designates 66.165.176.89 as permitted sender) Received: from [66.165.176.89] (HELO SMTP.CITRIX.COM) (66.165.176.89) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 19:30:09 +0000 X-IronPort-AV: E=Sophos;i="4.84,275,1355097600"; d="scan'208";a="636153" Received: from sjcpmailmx02.citrite.net ([10.216.14.75]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 13 Dec 2012 19:29:36 +0000 Received: from SJCPMAILBOX01.citrite.net ([10.216.4.72]) by SJCPMAILMX02.citrite.net ([10.216.14.75]) with mapi; Thu, 13 Dec 2012 11:29:36 -0800 From: Min Chen To: "cloudstack-dev@incubator.apache.org" Date: Thu, 13 Dec 2012 11:29:34 -0800 Subject: Re: [DISCUSS] Api refactoring -- validation Thread-Topic: [DISCUSS] Api refactoring -- validation Thread-Index: Ac3ZaC9f1swFhwDfSy2CTbP3r3OXww== Message-ID: In-Reply-To: <7A92FF96DF135843B4B608FB576BFC3E012DA27F45DC@SJCPMAILBOX01.citrite.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.5.121010 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the clarification, Animesh. On 12/13/12 10:46 AM, "Animesh Chaturvedi" wrote: >Hibernate allows writing custom validators. I think in this specific use >case, database lookup for index will be expensive and it is better to >throw UncheckedException in API Implementation when the index is not >found. > >Here is the link to API documentation > >http://docs.jboss.org/hibernate/validator/4.3/reference/en-US/html_single/ > > >Animesh > > > >> -----Original Message----- >> From: Min Chen [mailto:min.chen@citrix.com] >> Sent: Thursday, December 13, 2012 10:12 AM >> To: cloudstack-dev@incubator.apache.org >> Subject: Re: [DISCUSS] Api refactoring -- validation >>=20 >> One question regarding Hibernate Validator: does it support validation >>of >> existence of a DB entity with a given ID? The reason I am raising this >>question >> is that we have such a validation case in API refactoring. For example, >> deployVMCmd has an input parameter "templateId", for this parameter, we >> need to validate the template with the given id exists in the Template >>table. >> Not sure if Hibernate validator supports this scenario? By glancing >>through >> Hibernate validator doc, didn't find exact details on this, maybe I >>overlooked >> something. >>=20 >> Thanks >> -min >>=20 >> On 12/13/12 10:04 AM, "Fang Wang" wrote: >>=20 >> >Hibernate Validator >