Archive for the ‘ColdFusion’ Category

Returning Distinct ColdFusion Entities

Posted: April 30, 2012 in ColdFusion
Tags:

Take this code example: Each user can have multiple state licenses, thus what we get back here is an array of array of entities that have duplicated users. Lets take a couple of steps to fix this. 1. Change “JOIN U.stateLicenses” to “JOIN FETCH U.stateLicenses”. This will give us an array to work with instead [...]

In FW/1 you have the variables.fw.service method to work with in your controllers. This method will run your service’s method and return the results to a key inside the RC scope. Keep in mind, however, these service calls are queued up and not run until the view is called. Why this is done I have [...]

Recently I started switching from a Model-Glue implementation with ColdSpring to FW/1 (Framework One) with ColdSpring on a project of mine. An example service bean definition looks like this: With the new FW/1 code, I tried calling a method in this service by using: But ended up with this error: Service ‘geographic.getStatesByCountry’ does not exist. [...]

If you read my post on getting the ColdFusion Builder Console working and use ORM, you may have run into some further questions. When generating ORM, it’s wise to monitor what SQL queries Hibernate is generating for you, both for performance and debugging reasons. (Wasn’t ORM supposed to make my life easier?). To start logging ORM’s [...]

SQL to ColdFusion ORMType Reference

Posted: February 23, 2012 in ColdFusion, SQL

I have not been able to find a good reference chart out there that maps SQL Data Types to ColdFusion ORM Data Types. It’s always really been my best guess. So I’m going to start a reference chart here that as I figure it out I’ll update. If you have any input on this please [...]

Camel Case for Two Letter Acronyms

Posted: February 15, 2012 in ColdFusion

Here’s another “for later reference”… Microsoft’s rules for .NET Framework 1.1 Abbreviations consist of: Do not use abbreviations or contractions as parts of identifier names. For example, use GetWindow instead of GetWin. Do not use acronyms that are not generally accepted in the computing field. Where appropriate, use well-known acronyms to replace lengthy phrase names. [...]

This is pretty much a “note to self”… but in ColdFusion 9.01 you can now loop over arrays using the  for – in loop while in cfscript. Syntax is:

I have ColdFusion 9 Developer Edition installed on my Windows 7 machine running IIS7. Normally my ColdFusion 9 Application Server service starts automatically for me. Recently I have started learning and developing with ORM. Because of this, I need to figure out what ORM is asking the SQL server to make sure it’s not doing [...]

Consider the following code: (if you think the first line is odd – see Chaining ColdFusion Assignment Operators) My thought was r would return “1000/1000/1000″ — however it actually returned “1000″. Where did I go wrong? Now if I change a,b,c to 1000 it would blow up to a “cannot convert the value “1000/NO” to a [...]

I ran into an issue where using CFContent to serve a file with spaces in its name was truncating the file name. For example the file “Foo Bar.xls” was saving as “Foo”, lacking ” Bar.xls”. You can find many examples of this type of code out there for securing files using ColdFusion and its cfcontent, [...]