Why does the default value for a property not appear in when inserting via ED Grid?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Why does the default value for a property not appear in when inserting via ED Grid?

Post by EdB » Wed 24 Apr 2013 23:46

Hi,

I have setup a default value for a property of an entity ie Type="test". However when I append the row in the grid and CTRL-S, this default is not used? Is this a bug?

I am trying to test the Entity and how it behaves against the DB without writing MVC code.

Thanks.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by EdB » Thu 25 Apr 2013 09:53

Hi,

Now sorted. One has to use the default value setting for the Storage property as opposed to the Class Property. Then inserting rows via "Retrieve data" will use this default and enter into DB

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by EdB » Thu 25 Apr 2013 11:13

OK, I am confused again. It seems that there is a bug here in that "Retrieve Data" does not respect string default values, no issue with INTS. With INTS one can just setup up the default value on the class and it works a treat. With String, nothing.... just (null).

Thoughts.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by EdB » Thu 25 Apr 2013 11:43

Hi,

OK, I have found it. I think this can be described as a very undocumented feature in ED. The answer is to use single quotes around the string ie 'XXX', not "XXX" or XXX. So it seem that this value is passed straight thro to the DB which is expecting 'XXX' for strings.

Ed

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by Shalex » Thu 25 Apr 2013 16:58

This is correct. We are investigating the way to provide the possibility of setting string default value without quotes.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by EdB » Thu 25 Apr 2013 17:10

Not really a problem. Just needs highlighting. A short term fix would be to add this info to the help at the bottom so

>The default value for the property

could become

>The default value for the property. Remember strings should use single quotes ie 'test'.

That addition would have saved me half a day .

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Why does the default value for a property not appear in when inserting via ED Grid?

Post by Shalex » Tue 30 Apr 2013 15:53

EdB wrote:Just needs highlighting.
Thank you for the suggestion.

There will be a possibility of setting a string default value without quotes starting from the next build of Entity Developer. We will post here when it is available for download.

Post Reply