开发者

super() type functionality on ORM CFC

When I use CF9's ORM feature and generate an explict setter for my ORM CFC, is there anyway to call the default funcitionailty of the ORM CFC after i have done the work needed in the method. For example i am looking for something like this. Obviosuly the code will not run , and super is the wrong concept since the ORM CFC开发者_如何学JAVA isnt inherting anything, but thats the type of functionality I am looking for.

public void setMovie(String movie){
if(movie == "inception"){
ORMCFC.super().setMovie("Greatest movie ever made")
}else{
ORMCFC.super().setMovie(movie)
}


In your model CFC for the ORM you can specify additional "decorator" functions.

component persistent="true" table="Movie"  schema="dbo" output="false"
{
    /* properties */

    property name="MovieNo" column="MovieNo" type="numeric" ormtype="double" fieldtype="id" ; 
    property name="Name" column="Name" type="string" ormtype="string" ; 

    /* decorator */
    public void function setMovie(name)
    {
        if(name == "inception"){
            setName("Greatest movie ever made")
        }else{
            setName(name)
        }

    }
}

Otherwise if you need to (using your example) setMovie() you will need to do an EntityLoad or create a new entity to set a value to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜