Changes:
- Bean's setter functions now have two additional optional arguments: isNull and Validate
- Now the bean controls the length of fields and if something is nullable. Initially the generator will create the configuration for you but you can modify later by changing the setBeanConfig() function inside the bean CFC.
- The bean setter functions perform validation on the data passed in according to the specs from bean config.
- Each property of the bean has an isNull{property name} function
- All data coming from the database is considered trusted and will not be validated when passing it back to the bean setters.
You can download it here. The downloadable version contains a transformsbasic directory that contains the original transforms.
I am not sure I will put any other changes in the distribution as other suggestions were more specific and could be implemented in other ways. But, remember you can incorporate your changes just by modifying the XSL files. If you need some help, just contact me via the email address in the readme file.
You are not logged in, so your subscription status for this entry is unknown. You can login or register here.
I had never played around with xlst before and had no idea you could do some of the incredible things you're doing with it. Thanks for the code!
Oh, I also figured out that the generator didn't handle BigInt's, so I modified the cfswitch statement in the field.getFieldArgType function:
cfcase value="2,4,5,-5,6,-6,8"> cfset cfargtype = "numeric"> /cfcase>
cfcase value="93"> cfset cfargtype = "date"> /cfcase>
cfcase value="-1,1,12"> cfset cfargtype = "string"> /cfcase>
cfcase value="-7"> cfset cfargtype = "boolean"> /cfcase>
cfcase value="-4"> cfset cfargtype = "binary"> /cfcase>
cfdefaultcase> cfset cfargtype = "any,#getfieldtype()#"> /cfdefaultcase>
fwscott and the "at sign" comcast.net
These are the changes I had to make to get primary keys in postgresql 8 to work and to get anything to work for oracle:
Thanks!
Barny
183 : select * from indexqry 184 : WHERE 185 : NON_UNIQUE = #PreserveSingleQuotes(comparestrprimary)# 186 : 187 :
Which actually reflects throughout all the code and causes various problems. Just thought I'd mention it, feel free to ignore me. ;)
TO:
This succesffully generated everything else. Hope this works
But I just wanted to let you know that there are some nice ORM tools for ColdFusion now that are being actively developed.
Take a look at http://www.remotesynthesis.com/blog/index.cfm/2005/12/6/Arf-ObjectBreeze-Reactor-and-More
None of these existed when I first created my tool... I dont even use my tool most of the time now.
luis
Reactor is basically a factory built on top of a .xsl generator like mine. This keeps all the Coldfusion generated files in a standard CF inheritance format.
Arf! generates files but the factory weaves the generated methods into a class.
I havent really done timing tests on Reactor since v.5 or so but in my initial tests, the more joins an object has, the slower it ran. However, Arf! seemed to always have a specific overhead but didnt increase like Reactor did. Reactor's slowdown at the time seemed to revolve around the amount of query objects that needed to be created.
In the end, my current big project I went with a heavily revamped version of Arf! but I may be changing this because Reactor seems to have an active community and Im thinking it will get more development attention than Arf! because Joe is really pushing MG 1.1/2.0.
To sum it up... I think both are great frameworks and if you want to go with something that currently has some drive to it, go with Reactor. If you want to go with something that has lots of room to tweak performance, go with Arf.
Thanks
<xsl:text disable-output-escaping="yes"<&:nbsp;</xsl:text>
not sure if my escaping will work or not... check out the link attached to the comment
But nevertheless I'm really loving this tool.
I found one thing in the create method of the XXXDAO_ Microsoft_SQL_Server.cfc where it generates the NULL values null="#arguments.xxx.isNullxxx()#" the arguments.X does not match the argument that's referenced/passed in - i.e. comes out as arguments.category - when the argument that is passed in is called categoryBean.
I'm sure you know of this already - !
kp
I am building a system which has recordsets which need return 50,000 + records, and page though them. Gateways, as an array of objects is incredibly slow.
How does anyone else deal with this issue (apart from returning a query which I don't really want to do).
Or create some type of Iterator (maybe cached so the database only gets hit once) that loads a query and lazy loads the object as they are displayed. Then you could iterate through the objects as needed but if the page request only displayed 100 at a time, it would only create 100 objects. Perhaps even implement object pooling for the iterator so only one bean will ever exist and gets repopulated once the "next()" is called on the iterator.
<cfreturn evaluate("variables.beanconfig.#arguments.BeanConfigValue#") >
could be:
variables.beanconfig[arguments.beanConfigValue]
The things that old(er) code shows ;)
However, the xsl included is really for showing what can be done... not really what should be done. Customize it however you like.
Query Of Queries runtime error. Unsupported type comparison. The error occurred in C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\table.cfc: line 185 Called from C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\table.cfc: line 12 Called from C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\index.cfm: line 52 Called from C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\table.cfc: line 185 Called from C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\table.cfc: line 12 Called from C:\CFusionMX\wwwroot\cfccreator_original\cfccreator\index.cfm: line 52
183 : select * from indexqry 184 : WHERE 185 : NON_UNIQUE = #PreserveSingleQuotes(comparestrprimary)#
At first I thought it was one of my customizations (I mucked with the XSL files a little) but after reinstalling from the original .ZIP, it was still doing it. If you have any advice (or can just point me to the line in the README that I skipped *g*) that'd be a big help.
Cheers. -Nolan
The argument BEAN passed to function update() is not of type test2.CFC.MCQ_QNS