The User
object in our application will need a few properties for us to work with, for example, a username, user e-mail address, and password.
1. Let's create a folder named
model
in ourvideoshare
directory; this is where all our model objects are going to be stored so that they are out of the way, and we can easily tell where they are.2. In the
model
folder, create a file namedUser.cfc
and add the following content:component persistent="true"{ property name="id" fieldtype="id" ormtype="int" generator="increment"; property name="email"; property name="password"; property name="username"; }
3. In the previous code, we see that we have used the
persistent="true"
property; this alerts the ORM in Railo Server that it should create a table for this component. Then, we use theproperty name="id" fieldtype="id" ormtype="int" generator="increment"
; to define a unique ID for this property of the nameid
. We then add properties for e-mail, password...