Ticket #222 (closed defect: fixed)

Opened 19 years ago

Last modified 16 years ago

ModelGlue.GenericList Should return empty recordset

Reported by: imarichardson Owned by: joe.rinehart
Priority: normal Milestone:
Version: 2.0.304 Severity: major
Keywords: GenericList Cc:

Description

I've an application I'm running where I use a Generic List to output the data from a table. Consider the following: <message name="modelglue.GenericList?">

<argument name="object" value="tbl_users" /> <argument name="queryName" value="qryUsers" /> <argument name="criteria" value="userID" />

</message>

Now if for some reason userID is blank or not passed in the value of qryUsers.Recordcount should be zero in the viewstate (the recordset should be empty because I am running "SELECT * FROM tbl_users WHERE userID = ). Unfortunately, MG is returning what looks like either the complete recordset instead of an empty one. This can really be an issue if you are expecting a "return the right query" or "nothing at all" scenario.

Can this be fixed? Thanks.

Change History

Changed 19 years ago by joe.rinehart

  • owner changed from somebody to joe.rinehart
  • status changed from new to assigned

Changed 19 years ago by joe.rinehart

This had a nastier solutions than I'd like.

Basically, if the value specified in the criteria arg didn't exist, it didn't get passed to the ORM adapter as a criteria.

It sounds simple to simple default it to empty string, etc., but we've got no way of knowing what data type the underlying ORM implementation expects: default to empty string, in your example, would probably through an "invalid type for CF_SQL_INTEGER," etc.

To work around this, I've added two types of "expressions" to the "criteria" value....you can now state static and default values for the attributes listed.

To state "userID with a default of zero and enabled with a static value of 1" you'd state:

<argument name="criteria" value="userID:0,enabled=1" />

Basically, ":" = default, "=" = static value

Changed 19 years ago by joe.rinehart

  • status changed from assigned to closed
  • resolution set to fixed

(In [253]) Fixes #222

Changed 16 years ago by cfgrok

  • milestone User Reported Issues (with full information) deleted

Milestone User Reported Issues (with full information) deleted

Note: See TracTickets for help on using tickets.