Name | Type | Required | Default | Hint |
entityName | string | true | The name of the entity without .cfc | |
table | string | false | The name of the mapped table or empty to use the same name as the entity | |
directory | string | false | models | The base directory to create your model in and creates the directory if it does not exist. |
activeEntity | boolean | false | false | Will this be a ColdBox ORM Active entity or a Normal CFML entity. Defaults to false. |
primaryKey | string | false | id | Enter the name of the primary key, defaults to 'id' |
primaryKeyColumn | string | false | Enter the name of the primary key column. Leave empty if same as the primaryKey value | |
generator | string | false | native | Enter the ORM key generator to use, defaults to 'native' |
properties | string | false | Enter a list of properties to generate. You can add the ORM type via semicolon separator, default type is string. Ex: firstName,age:numeric,createdate:timestamp | |
tests | boolean | false | true | Generate the unit test BDD component |
testsDirectory | string | false | tests/specs/unit | Your unit tests directory. Only used if tests is true |
script | boolean | false | true | Generate as script or not, defaults to true |
open | boolean | false | false | Open the file(s) once generated |
Create a new CFML ORM entity. You can pass in extra attributes like making it an enhanced ColdBox ORM Active Entity, or generating
primary keys and properties.
You can pass a primary key value or use the default of 'id'. You can then pass also an optional primary key table name and generator.
The default generator used is 'native'
To generate properties you will pass a list of property names to the 'properties' argument. You can also add
ORM types to the properties by separating them with a semicolon. For example:
properties=name,createDate:timestamp,age:numericMake sure you are running this command in the root of your app for it to find the correct folder.
// Basic
coldbox create orm-entity User --open
// Active Entity
coldbox create orm-entity User --open --activeEntity
// With Some Specifics
coldbox create orm-entity entityName=User table=users primaryKey=userID generator=uuid
// With some properties
coldbox create orm-entity entityName=User properties=firstname,lastname,email,createDate:timestamp,updatedate:timestamp,age:numeric