After a change to the model of an application, the [[Invantive Studio/Repository/Concepts/Generation of the Business Layer|business layer is generated]] again. The generation runs in the database:
- Make sure the tables match the model; see [[Invantive Studio/Repository/Procedures/Synchronise the Database with the Model|Synchronise the Database with the Model]].
- [[Invantive Studio/Repository/Procedures/Log On to the Business Layer in a Script|Log on to the business layer]] as the owner of the schema.
- In the block of the log-on, replace `null;` by the generation procedure of the application. For Invantive Estate that is:
```sql
bubs_sct_generate.run
( p_bubs_usr => user
, p_itgen_role_web => user || '_USER'
, p_itgen_role_reader => user || '_READER'
, p_pattern => '%'
);
```
- Pass the names of the roles of the installation as the user role and the reader role; the generation grants the business objects to them.
- An application without a generation procedure of its own calls `itgen_install_database.install` with the owner, the user role and the reader role in the same way.
- Install the hand-written [[Invantive Studio/Repository/Concepts/Hook Package|hook packages]] again if the generation replaced any of them.
The generation compares every object it would create with the object in the database and skips the ones that are already current. A full run takes two to five seconds per business object; during development `p_pattern` limits it to the business objects whose names contain the pattern, such as `'%project_saldo%'`.