Get an object from the db if it exists, create it if it doesn't.
If the object is created, the code in the enclosed block is executed.
<db:get-or-create model="#Permission" let:name="'admin'"let:description="'User may perform administration tasks'"><echo>New permission was created.</db:get-or-create>
name | purpose | type | required? | default | choices |
---|---|---|---|---|---|
created |
Destination to store created flag | index | No | ||
db |
Database name | text | No | "_default" |
|
filter |
Filter expression | database expression | No | ||
forupdate |
Issue a select FOR UPDATE? | boolean | No | no |
|
from |
Application | application reference | No | ||
initial |
Object with initial values | expression | No | None |
|
model |
Model element reference | text | Yes |
name | purpose | type | required? | default | choices |
---|---|---|---|---|---|
dst |
Destination | reference | No | ||
if |
Conditional expression | expression | No | yes |
|
value |
Value | expression | No | None |