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="doSaveApiEvent" access="public" returntype="any"
output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<cfset var rc = Event.getCollection() />
<cfscript>
if(event.valueExists("apiEventID"))
{
apiEvent =
getPlugin("ioc").getBean("ApiEventManager").getApiEvent(event.getValue("apiEventID"));
}
else
{
apiEvent =
getPlugin("ioc").getBean("ApiEventManager").getApiEvent("");
};
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"));
};
</cfscript>
<cfset saveApiEvent =
getPlugin("ioc").getBean("ApiEventManager").saveApiEvent(apiEvent:
apiEvent)>
<cfreturn saveApiEvent />
</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 Thu, Aug 27, 2009 at 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?
>>
>>
>
--
Jim Rising
Serial Entrepreneur
Software Engineer
Web Developer
"Knowledge work requires both autonomy and accountability."
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---