Mar 4
I'm still trying to wrap my head around the relationships in ORM. Yesterday I wanted to delete all the child entities with the parent is delete. No problem, there is an attribute for that. cascade="all-delete-orphan". Well, it wasn't working for me.
It turned out, in my Mach-II app I was using event-bean (by mistake) to prepare the bean and then calling EntityDelete() on it. The entity was getting deleted but the child entities were not getting deleted. No error either. Once I realized my mistake (event-bean), and changed to call-method to load the entity and then call entityDelete() on it everything worked fine.
So, what is the bug? Here is the code equivalent (artist-art example) of my mumbo-jumbo above:
Read more...
Jan 19
Great research article on TDD from Microsoft.
http://research.microsoft.com/en-us/news/features/nagappan-100609.aspx
Read more...
Jan 18
I had an interesting observation about datatype conversion in CF9 when dealing with an error in ORM. I was getting an error that said can't use double for an integer field type (something like that). Now, I know that ColdFusion is datatype "independent". So, all simple variables are of datatype "String". Given that, when we do:
Read more...
Nov 10
ColdFusion's built in function getTimeZoneInfo() doesn't allow you to pass a date. It give you the server timezone info and offset as of "now" (as in, when the code is run).
If you need to find the timezone offset for a specific date, you can use the TimeZone class from java. Here is the code.
<cfset myDate = "11/01/09" />
<cfset timeZone = createObject("java","java.util.TimeZone") />
<cfset myTimeZone = timeZone.getTimeZone("America/New_York") />
<cfset myTimeZoneOffset = myTimeZone.getOffset(1,year(myDate),month(myDate),day(myDate),dayOfWeek(myDate),0) />
Nov 10
I'm slowly migrating to writing script style components. I really started loving it. It's lot faster to write code in script style.
Anyway, today in one of my component I wanted to define the type of a property as a custom class. Since you can't write any code above property definition, on a whim, I tried the import outside of the component declaration and I was pleasantly surprised that it worked as expected!
import someClassPath.*;
component {
property MyClassName myClass;
public void function init() {
return this;
}
}
Recent Comments