Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 232BAD3B6 for ; Fri, 3 Aug 2012 11:44:39 +0000 (UTC) Received: (qmail 31196 invoked by uid 500); 3 Aug 2012 11:43:42 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 31173 invoked by uid 500); 3 Aug 2012 11:43:42 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 31137 invoked by uid 99); 3 Aug 2012 11:43:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 11:43:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.161.171] (HELO mail-gg0-f171.google.com) (209.85.161.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 11:43:36 +0000 Received: by ggmi1 with SMTP id i1so1345536ggm.16 for ; Fri, 03 Aug 2012 04:43:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=WDEtjJL6M0EedOjyElN9OG3rA1VM6zMGff2O5s3DcOY=; b=YVzLwYIIHFs265hGAW3t6gZKGk9Qy/aDnPck4+eQt8RDxQ1KK5O3Bf0YqCJavtEH0X gaRQ4xUcZf/hrWkL4gkolrPyG6hzphKXSb+bRGie/g9SE6OpyMqHnoHWjUxb9scrdFqu Lo2PpXEr7tCSC4jaTVEidDEW2o5CWAwaGtUGiUMD/i8NqYrDd7CWtyUiNJFRtfmSDt7C A0agNRVth3zcbCbMwhYRIO9zP04m0KcDF3L+BOXQaWdxFKUgu3erPmEyqRvyv4fnSj/w RFeKUZKRTqEu6uqOECIoQOqwNkKDLT59I3yfTlvhUBTiYjhsxiif3OAAn1qc7gJJk1vi X57w== Received: by 10.50.36.131 with SMTP id q3mr2851114igj.56.1343994195260; Fri, 03 Aug 2012 04:43:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.25.18 with HTTP; Fri, 3 Aug 2012 04:42:54 -0700 (PDT) In-Reply-To: References: <1343377148960-4024463.post@n3.nabble.com> <1343974098867-4024479.post@n3.nabble.com> <4B967FDC-7002-4448-87C3-68E67DB6DF34@objectstyle.org> <0B66C110-D444-457E-AFA7-7DF875F66A3F@objectstyle.org> From: Michael Gentry Date: Fri, 3 Aug 2012 07:42:54 -0400 Message-ID: Subject: Re: Can default values be set in Constructor instead of setPersistenceState()? To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQm4B2LkPbn2fxGHvzXXWFGAyqJU1QHvf4/2gvOA8LRNUszfrDDQMnM+KgybTZ0hBq87CYGH X-Virus-Checked: Checked by ClamAV on apache.org Hi Kanwar, ObjectContext is an interface. You are most likely actually using a DataContext, which inherits from BaseContext (which implements ObjectContext). mrg On Fri, Aug 3, 2012 at 7:04 AM, Kanwar Manish wrote: > Hey Thanks again > > This worked out like a charm. > > But I am using ObjectContext for creating my objects. I hope that is not > the problem? > > Thanks > Kanwar Manish > > On Fri, Aug 3, 2012 at 3:54 PM, Andrus Adamchik wrote: > >> I am an Eclipse user.. I have no NetBeans experience at all unfortunately. >> >> But you can get the source jars matching Cayenne binary jars straight from >> Maven repo. Here is the one you likely need: >> >> >> http://search.maven.org/remotecontent?filepath=org/apache/cayenne/cayenne-server/3.1B1/cayenne-server-3.1B1-sources.jar >> >> Andrus >> >> On Aug 3, 2012, at 1:16 PM, Kanwar Manish wrote: >> >> > Thanks Andrus. >> > >> > I am afraid that will be a bit tough for me - for now. I am a complete >> Java >> > and Linux noob, coming from .NET background. >> > >> > I tried attaching 3.1B1 source to the binaries [in Netbeans 7.2] but >> > failed. I just can't figure out which source folder to attach with which >> > Cayenne Jar [Client, server, tools or lifecycle]. >> > >> > Can anybody help me out here please? >> > >> > Thanks >> > Manish >> > >> > >> > >> > On Fri, Aug 3, 2012 at 1:28 PM, Andrus Adamchik > >wrote: >> > >> >> Hi, >> >> >> >> I am not aware of any issues with PostAdd. Your best bet is to debug >> >> inside Cayenne DataContext.newObject(..). Specifically in BaseContext >> there >> >> is a method "injectInitialValue" that has this line at the end: >> >> >> >> // invoke callbacks >> >> getEntityResolver().getCallbackRegistry().performCallbacks( >> >> LifecycleEvent.POST_ADD, >> >> object); >> >> >> >> This is where callbacks are invoked. Please share what you find here, >> and >> >> maybe based on those clues we can unwind it further. >> >> >> >> Cheers, >> >> Andrus >> >> >> >> >> >> On Aug 3, 2012, at 9:08 AM, KM wrote: >> >> >> >>> Removed the check for the key. >> >>> >> >>> It seems that the problem is that this is not getting fired at all. >> >>> Breakpoint is not being hit. This is strange. >> >>> >> >>> I have checked for the abstract declaration in the parent class. >> Setting >> >>> this up in the modeler. >> >>> >> >>> Has anyone faced this problem before? >> >>> >> >>> Thanks >> >>> Kanwar Manish >> >>> >> >>> >> >>> >> >>> -- >> >>> View this message in context: >> >> >> http://cayenne.195.n3.nabble.com/Can-default-values-be-set-in-Constructor-instead-of-setPersistenceState-tp3320047p4024479.html >> >>> Sent from the Cayenne - User mailing list archive at Nabble.com. >> >>> >> >> >> >> >> >>