• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Entity Modeler, attributes default value for migrations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Entity Modeler, attributes default value for migrations


  • Subject: Re: Entity Modeler, attributes default value for migrations
  • From: Theodore Petrosky <email@hidden>
  • Date: Thu, 19 Apr 2012 15:09:35 -0700 (PDT)

But here is the gotcha!

in Entity Modeler (or hand editing the plist file) you must use

userInfo = {default = 0; };

note the zero NOT false!!

if you use 'false' or 'true', EM creates the migrations okay, however creating a new object in D2W throws errors:


Apr 19 18:05:52 ASBriefsD2W[57541] WARN  NSLog  - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
java.lang.NumberFormatException
[2012-4-19 18:5:52 EDT] <WorkerThread0> java.lang.NumberFormatException
	at java.math.BigDecimal.<init>(BigDecimal.java:459)
	at java.math.BigDecimal.<init>(BigDecimal.java:728)

so the userInfo = {default = 0; };

thank you John for pointing out the zero.

Ted



--- On Wed, 4/18/12, Chuck Hill <email@hidden> wrote:

> From: Chuck Hill <email@hidden>
> Subject: Re: Entity Modeler, attributes default value for migrations
> To: "John Huss" <email@hidden>
> Cc: "Theodore Petrosky" <email@hidden>, "WebObjects-Dev Mailing List List" <email@hidden>
> Date: Wednesday, April 18, 2012, 5:05 PM
> Hand edit? 
> Eeew!   :-P
>
> Select the property and then the User Info tab in the
> Properties inspector.  Click where it says (0 items)
> and hit Enter.  Edit the name and value.
>
>
> Chuck
>
>
> On 2012-04-18, at 1:07 PM, John Huss wrote:
>
> > You have to add it manually into the userInfo
> dictionary by editing by model with a text editor.  For
> example, for the ATTRIBUTE called "deleted":
> >
> > ...
> >         {
> >         
>    columnName = "scp_deleted";
> >         
>    name = deleted;
> >         
>    prototypeName = intBoolean;
> >         
>    userInfo = {default = 0; };
> >         
>    width = 1;
> >         }
> > ...
> >
> > On Wed, Apr 18, 2012 at 2:33 PM, Theodore Petrosky
> <email@hidden>
> wrote:
> > When I create an attribute in Entity Modeler, and
> create the migrations, it does a beautiful job.
> >
> > creativeBriefTable.newFlagBooleanColumn("isfiled",
> false);
> >
> > and I know I can add a default value here
> >
> > creativeBriefTable.newFlagBooleanColumn("isfiled",
> false, false);
> >
> > problem is that if I go back and alter the schema and
> recreate the migration, I must remember to add in the
> default selector(s).
> >
> > I don't see in EM where I could put in a default value
> (or I am blind).
> >
> > Is there a place to put in a default value in Entity
> Modeler so the migrations it creates include the default
> value?
> >
> > Ted
> >  _______________________________________________
> > Do not post admin requests to the list. They will be
> ignored.
> > Webobjects-dev mailing list      (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be
> ignored.
> > Webobjects-dev mailing list      (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
>
> --
> Chuck Hill         
>    Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase
> their overall knowledge of WebObjects or who are trying to
> solve specific problems.   
> http://www.global-village.net/gvc/practical_webobjects
>
>
>
>
>
>
>
>
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: ERRest keys renaming
  • Next by Date: Re: WOUnit
  • Previous by thread: Re: Entity Modeler, attributes default value for migrations
  • Next by thread: A problem with http request to a webobjects site
  • Index(es):
    • Date
    • Thread