O'Reilly logo

Railo 3 Beginner’s Guide by Mark Drew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - adding comments to our videos

  1. In our model folder, which is under the videoshare directory, let's create a new component named Comment.cfc and add the following code to define it:
    component persistent="true" {
    property name="id" fieldtype="id" ormtype="int" generator="increment";
    property name="comment";
    property name="postedAt" ormtype="timestamp";
    property name="User" fieldtype="many-to-one" cfc="User" fkColumn="User_Id";
    property name="Video" fieldtype="many-to-one" cfc="Video" fkColumn="Video_Id";
    }
    
  2. In the previous code, we have defined a comment as having an id, a comment property, and the date it was posted. We have also defined its relationships to the other model objects in our application. A user can have many comments; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required