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 - storing our video to the database

  1. Let's create a Video.cfc file in our model folder under the videoshare folder and add the following code to the template:
    component persistent="true"{
    property name="id" fieldtype="id" ormtype="int" generator="increment";
    property name="title";
    property name="status" ormtype="int" default="0";
    property name="originalfile";
    property name="file";
    property name="convertedAt" ormtype="timestamp";
    property name="uploadedAt" ormtype="timestamp";
    property name="User" fieldtype="many-to-one" cfc="User" fkColumn="User_Id";
    }
    
  2. Working through the code, we can see it's very similar to the User object. It has an id property (the primary key), but we can see we have other types of properties that are defined ...

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