Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12FA69D9D for ; Wed, 16 Nov 2011 16:15:58 +0000 (UTC) Received: (qmail 14256 invoked by uid 500); 16 Nov 2011 16:15:57 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 14225 invoked by uid 500); 16 Nov 2011 16:15:57 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 14215 invoked by uid 99); 16 Nov 2011 16:15:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 16:15:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zoigln@googlemail.com designates 209.85.220.181 as permitted sender) Received: from [209.85.220.181] (HELO mail-vx0-f181.google.com) (209.85.220.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 16:15:52 +0000 Received: by vcbfk14 with SMTP id fk14so716092vcb.12 for ; Wed, 16 Nov 2011 08:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=drIcEuaaANl76U1nQ7lbBmihmQL9vLJOuyU+tklGBao=; b=vLcyke/qpugWsru5lXmte+3WJafXXuNFvMyzIOi6GSt2EB75qhQ1ZKVYNxX0ZIovkS JapOosDE47yeIF6kTVfg7NN0MIkG71EZCYzEQFKTBdZM3+NGXs1Y8m/eOJXCKDicZsL0 1wq1bYKjj2JV1vkXG5gNOrbU+W9K5JKuZoL5k= MIME-Version: 1.0 Received: by 10.52.20.209 with SMTP id p17mr51786391vde.60.1321460131841; Wed, 16 Nov 2011 08:15:31 -0800 (PST) Received: by 10.220.94.135 with HTTP; Wed, 16 Nov 2011 08:15:31 -0800 (PST) Date: Wed, 16 Nov 2011 17:15:31 +0100 Message-ID: Subject: Best practices for validating an complete object/entity From: Thomas Andraschko To: MyFaces Discussion Content-Type: multipart/alternative; boundary=20cf307d05ccbe472e04b1dc695e --20cf307d05ccbe472e04b1dc695e Content-Type: text/plain; charset=ISO-8859-1 Hi, i have some input fields for an entity and i want to check if the entered name does already exist. So i tried to create an BV constraint for the name property but i also need the parent entity object (for checking if the entity is transient or not). In a BV validator i can't get the the parent entity - so it's useless. The other idea was to attach it on bean property level for the entity: @UniqueName private Entity entity. But this wont validate the entity. I thought about an custom converter and binding the #{bean.entity}. The problem is, in getAsObject i must load the entity by the name and the bean.entity will be overwritten. Or not? How can i prevent that the #{bean.entity} will be overwritten? Is there another solution for validate the entity? I also use CODI and ExtVal. Thanks! Best regards, Thomas --20cf307d05ccbe472e04b1dc695e--