sorry... last message contained errata (wrong handler method).

So to bring us to where we are... here is my transfer config:

        <package name="apiEvent">
            <object name="ApiEvent" table="apievents"
decorator="workspace.svn_fiduciaryEdge.trunk.model.decorators.apiEvent">
                <id name="apiEventID" column="apiEventID"
type="numeric" generate="false" />
                <property name="name" column="name" type="string"
nullable="false" />
                <property name="description" column="description"
type="string" nullable="false" />
                <property name="loginRequired" column="loginRequired"
type="boolean" nullable="true" />
                <function name="configure" access="private"
returntype="void">
                     <body>
                         <![CDATA[<cfset setLoginRequired("NULL")>]]>
                     </body>
                </function>
            </object>
        </package>

Here is my handler:

        <cffunction name="getByAttributesRelated" access="public"
returntype="any" output="false">
                <cfargument name="Event" 
type="coldbox.system.beans.requestContext">
                <cfset var rc = Event.getCollection() />
                <cfset var apiEvent = getPlugin("ioc").getBean
("ApiEventManager").getApiEvent("")>


                <cfset var sortBy = "">
                <cfset var orderAsc = "true">

                <cfscript>
                        if(event.valueExists("apiEventID"))
                        {
                                
apiEvent.setApiEventID(event.getValue("apiEventID"));
                        };

                        if(event.valueExists("name"))
                        {
                                apiEvent.setName(event.getValue("name"));
                        };
                        if(event.valueExists("description"))
                        {
                                
apiEvent.setDescription(event.getValue("description"));
                        };

                        if(event.valueExists("loginRequired"))
                        {
                                
apiEvent.setLoginRequired(event.getValue("loginRequired"));
                        };
                        if(event.valueExists("sortBy"))
                        {
                                sortBy = event.getValue("sortBy");
                        };
                        if(event.valueExists("orderASC"))
                        {
                                orderAsc = event.getValue("orderAsc");
                        };
                </cfscript>

                <cfset apiEvents = getPlugin("ioc").getBean
("ApiEventManager").getByAttributesRelated(apiEvent: apiEvent, sortBy:
sortBy, orderAsc: orderAsc) />


                <cfreturn apiEvents />
        </cffunction>


and the relevant portion of my manager:


    <cffunction name="getByAttributesRelated" access="public"
returntype="any">
        <cfargument name="apiEvent" type="transfer.com.transferObject"
required="true">
        <cfargument name="sortBy" type="string" required="false"
default="userID">
        <cfargument name="orderAsc" type="string" required="false"
default="true">

        <cfset var apiEventID = arguments.apiEvent.getApiEventID()>
        <cfset var name = arguments.apiEvent.getName()>
        <cfset var description = arguments.apiEvent.getDescription()>
        <cfset var loginRequired = arguments.apiEvent.getLoginRequired
()>

        <cfscript>
        map = StructNew();
        if(apiEventID GT "" and apiEventID NEQ 0)
        {
            map.apiEventID = apiEventID;
        }
        if(name GT "")
        {
            map.name = name;
        }
        if(description GT "")
        {
            map.description = description;
        }
        if(loginRequired GT "" AND loginRequired NEQ "NULL")

        {
            map.loginRequired = loginRequired;
        }


        // get a query of the users that match this map
        apiEvents = transfer.listByPropertyMap("apiEvent.ApiEvent",
map, "#arguments.sortBy#", #arguments.orderASC#);

--
Jim Rising
Serial Entrepreneur
Software Engineer
Web Developer

"Knowledge work requires both autonomy and accountability."

On Aug 27, 9:45 am, Jim Rising <[email protected]> wrote:
> tried that:
>
> can't cast String [NULL] to a value of type [boolean]
>
> bummer. :(
>
> --
> Jim Rising
> Serial Entrepreneur
> Software Engineer
> Web Developer
>
> "Knowledge work requires both autonomy and accountability."
>
> On Wed, Aug 26, 2009 at 8:24 PM, Bob Silverberg 
> <[email protected]>wrote:
>
>
>
> > OK, well if they're nullable you could use configure() to default the
> > property to NULL, and then check for nulls in your method rather than
> > checking for "".  Does that make sense?
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to