A common design I use is to set a date column with the current date as the default. For SQL Server I use getDate() and for MySQL now() or current_timestamp.
Implementing a MySQL solution in ORM, seemed the way to do it would be:
property name="dtSaved" ormtype="date" dbdefault="now()";
However, this isn’t working, but isn’t throwing an error either. When I run ORMReload(), it seems to get stuck on this table, and none of the entities that come after (alphabetically) get created. (I’m using dbcreate=”dropcreate”)
Note that this is Railo 3.3.1, not Adobe ColdFusion 9.
You can set a dynamic default value in your constructor, so something like this:
Comment by John Whish – November 22, 2010
from:
http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/coldfusion-9-orm-example-215