Model Module

Overview

This module is used for defining new model which represents database table. Please see also an article describing defining model using XML.

Module's schema is defined in model.xsd.

Attributes

name

type

required

description

model

string

yes

Name of the model.
Together with plugin identifier it will be used in the whole system to identify model.
Please note that its value must be unique in the plugin.

resource

file

yes

Path to the file defining model.
Please see an article describing defining model using XML.

Example

Please find below an example of plugin defining one model module. Line 8 contains a sampleModel model which is defined in the file src/main/resources/samplePlugin/model/samplePlugin.xml.

<?xml version="1.0" encoding="UTF-8"?>
<plugin plugin="samplePlugin" version="1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://schema.qcadoo.org/plugin" 
    xmlns:model="http://schema.qcadoo.org/modules/model" 
    xsi:schemaLocation="http://schema.qcadoo.org/plugin http://schema.qcadoo.org/plugin.xsd http://schema.qcadoo.org/modules/model http://schema.qcadoo.org/modules/model.xsd">

    <model:model model="sampleModel" resource="model/samplePlugin.xml" />

</plugin>