|
Loading...
|
mach-ii-for-coldfusion@googlegroups.com
[Prev] Thread [Next] | [Prev] Date [Next]
[Mach-II] CF 9 ORM & Mach-II Eric Cobb Wed Apr 04 06:09:34 2012
I'm finally getting a chance to play with CF 9's ORM, and I'm having a
problem getting it to work in my Mach-II app. My example is pretty simple,
so I'm hoping that there's just something that I don't have configured
correctly and someone here can offer me some pointers. All I'm trying to
do is insert a Name, Email, and Password from a form into an already
created DB table.
Here is what I have so far:
userListener.cfc
<cffunction name="saveUser" output="false" access="public"
returntype="void" hint="I create/update a user's information">
<cfargument name="event" type="MachII.framework.Event"
required="true" />
<cfset getuserService().save(arguments.event.getArgs()) />
</cffunction>
userService.cfc
<cffunction name="save" access="public" output="false" returntype="void">
<cfargument name="userInfo" type="struct" required="true">
<cftry>
<cfset var objUser = EntityNew("user")>
<cfset objUser.setid(createuuid())>
<cfset objUser.setemail(arguments.userInfo.email)>
<cfset objUser.setpassword(arguments.userInfo.password)>
<cfset objUser.setname(arguments.userInfo.name)>
<cfset EntitySave(objUser,true)>
<cfabort>
<cfcatch type="any">
<cfdump var="#cfcatch#">
<cfabort>
</cfcatch>
</cftry>
</cffunction>
Pretty straight forward, right? For whatever reason, I can't get
EntitySave() to work. I don't get an error, the browser just spins and
spins until CF eventually times out. If I put a dump just before
EntitySave() all of the data is there and correct. my ORM CFC is pretty
basic, too:
user.cfc
<cfcomponent displayname="user" output="false" persistent="true"
table="user">
<cfproperty name="id" type="uuid" fieldtype="id" generator="uuid">
<cfproperty name="email">
<cfproperty name="password">
<cfproperty name="name">
</cfcomponent>
I'm not sure if it matters, but here are the settings from my
Application.cfc file:
<cfset this.ormenabled = "true">
<cfset this.datasource = "myDsn">
<cfset this.ormsettings = {cfclocation="model/orm",dialect="MySQL"}>
So, does anyone have any idea as to what could be going on? Am I missing
some settings or code somewhere? Since I'm not getting any type of error,
and this is my first time fooling with ORM, I'm kinda at a loss as to what
to look for.
Thanks,
Eric Cobb
http://www.cfgears.com
--
To post to this group, send email to [EMAIL PROTECTED]
For more options and to unsubscribe, visit this group at
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
- [Mach-II] CF 9 ORM & Mach-II Eric Cobb 2012/04/04 <=
- re: [Mach-II] CF 9 ORM & Mach-II Eric Cobb 2012/04/04
- Re: [Mach-II] CF 9 ORM & Mach-II Sumit Verma 2012/04/04
- Re: [Mach-II] CF 9 ORM & Mach-II Brian Klaas 2012/04/04