または、コンポーネントを永続化せずにデフォルトのプロパティ値を有効にすることはできますか?
はい、init()メソッドで設定するだけです。
<cfcomponent name="person" persistent="false" output="false">
<cfproperty name="gender"><!--- Non-persistent CFC: you can't set a default here --->
<cffunction name="init" output="false>
<cfset variables.gender = "m"><!--- Set the default here --->
</cffunction>
</cfcomponent>
プロパティ宣言では単純なデフォルト値(リテラル文字列や整数など)しか設定できないため、複雑な値または動的な値のデフォルト(配列や現在の日付など)の永続CFCでもこれを行う必要があります。
<cfcomponent name="person" persistent="true" table="persons" output="false">
<cfproperty name="gender" default="m"><!---Persistent CFC, so this simple default will be set --->
<cfproperty name="dateCreated"><!---You can't set a default dynamic date value --->
<cffunction name="init" output="false>
<cfset variables.dateCreated= Now()><!--- Set the current datetime here --->
</cffunction>
</cfcomponent>