Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved the Application ORMSettings details to a separate page for the LD-159 #1306

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Defines a mail listeners for cfmail
Defines a mail listeners for [[tag-mail]]

See the [[cookbook-mail-listeners]] for details
28 changes: 2 additions & 26 deletions docs/03.reference/02.tags/application/_attributes/ormsettings.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
A struct that defines all the ORM settings, the following keys are supported:
A struct that defines all the ORM settings,

- **autogenmap(default:true; autogenmap=false is not supported yet):** Specifies whether Lucee should automatically generate mapping for the persistent CFCs. If autogenmap=false, mapping should be provided in the form of "{cfc-name}.cfc.hbm.xml" files.
- **automanageSession(default:true; not supported yet):** Lets you specify if Lucee must manage Hibernate session automatically. If enabled: Lucee manages the session completely. That is, it decides when to flush the session, when to clear the session, and when to close the session. If disabled: The application is responsible for managing flushing, clearing, or closing of the session. The only exception is (in the case of transaction), when the transaction commits, the application flushes the session. Lucee closes the ORM session at the end of request irrespective of this flag being enabled or disabled.
- **cacheconfig:** Specifies the location of the configuration file that should be used by the secondary cache provider.This setting is used only when secondarycacheenabled=true.
- **cacheprovider:** Specifies the cache provider that should be used by ORM as secondary cache.
- **catalog:** Specifies the default Catalog that should be used by ORM.
- **cfclocation:** Specifies the directory (or array of directories) that should be used by Lucee to search for persistent CFCs to generate the mapping. If cfclocation is set, Lucee looks at only the paths specified in it. If it is not set, Lucee looks at the application directory, its sub-directories, and its mapped directories to search for persistent CFCs.
- **datasource:** Specifies the data source that should be used by ORM. If it is not specified here, then the data source specified for the application is picked up.
- **dbcreate(default:none):** Hibernate can automatically create the tables for your application in the database. dbCreate takes the following **values:**

- **update:** Setting this value creates the table if it does not exist or update the table if it exists.

- **dropcreate:** Setting this value drops the table if it exists and then creates it.

- **none:** Setting this value does not change anything in the database schema.
- **dialect:** Specifies the dialect.Lucee supports the following dialects: [Cache 2007.1, Cache71, Cache 2007.1, DB2, DB2/390, DB2/400, DB2390, DB2400, DB2AS400, DB2OS390, DataDirectOracle9, Derby, Firebird, FrontBase, H2, H2DB, HSQL, HSQLDB, Informix, Ingres, Interbase, JDataStore, MSSQL, Mckoi, MckoiSQL, MicrosoftSQLServer, Mimer, MimerSQL, MySQL, MySQL/InnoDB, MySQL/MyISAM, MySQL5, MySQL5/InnoDB, MySQL5InnoDB, MySQLInnoDB, MySQLMyISAM, MySQLwithInnoDB, MySQLwithMyISAM, Oracle, Oracle10g, Oracle8i, Oracle9, Oracle9i, Pointbase, PostgreSQL, PostgresPlus, Progress, SAPDB, SQLServer, Sybase, Sybase11, SybaseASE15, SybaseAnywhere, com.ddtek.jdbc.db2.DB2Driver, com.microsoft.jdbc.sqlserver.SQLServerDriver, oracle.jdbc.driver.OracleDriver, org.firebirdsql.jdbc.FBDriver, org.gjt.mm.mysql.Driver, org.h2.Driver, org.hsqldb.jdbcDriver, org.postgresql.Driver]
- **eventHandling(default:false):** Specifies whether ORM Event callbacks should be given.
- **flushatrequestend(default:true):** Specifies whether ormflush should be called automatically at request end. If flushatrequestend is false, ormflush is not called automatically at request end.
- **logSQL(default:false):** Specifies whether the SQL queries that are executed by ORM will be logged. If LogSQL=true, the SQL queries are logged to the console.
- **ormconfig:** The Hibernate configuration file. This file contains various configuration parameters like, dialect, cache settings, and mapping files that are required for the application. For more details, see <http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html>. The settings defined in the ormsettings override the settings defined in the Hibernate Configuration XML file.The connection information in the Hibernate Configuration XML file is however ignored because Lucee uses its own connection pool. You will need to use this only when you need to use a hibernate setting that is not available using ormsetting.
- **savemapping(default:false):** Specifies whether the generated Hibernate mapping file has to be saved to disc. If you set the value to true, the Hibernate mapping XML file is saved with the filename "CFC name".hbm.xml in the same directory as the CFC. If any value of savemapping is specified in CFC, it will override the value specified in the ormsetting.
- **schema:** Specifies the default Schema that should be used by ORM.
- **secondarycacheenabled(default:false):** Specifies whether secondary caching should be enabled
- **skipCFCWithError(default:false;not implemented yet):** Lets you specify if Lucee must skip the CFCs that have errors. If set to true, Lucee ignores the CFCs that have errors.
- **sqlscript:** Path to the SQL script file that gets executed after ORM is initialized. This applies if dbcreate is set to dropcreate. This must be the absolute file path or the path relative to the application.The SQL script file lets you populate the tables before the application is accessed.
- **useDBForMapping(default:true):** Specifies whether the database has to be inspected to identify the missing information required to generate the Hibernate mapping. The database is inspected to get the column data type, primary key and foreign key information.
see the [[cookbook-Application-ORMSettings]] for the details
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: ORM Settings configuration via Application
id: cookbook-Application-ORMSettings
related:
- tag-application
categories:
- application
- orm
description: detailed description for the ORM Settings configured via Application.cfc/cfapplication
---

### Application ORM Settings configurations ###

This page gives the detailed description of the ORM settings for the [[tag-application]]

i.e.<code>Application.cfc</code>

```luceescript
component {
this.name = "ORMTest";
this.ORMEnabled = true;

this.ormsettings.dbcreate = "update";
this.ormsettings.dialect = "MicrosoftSQLServer";
}

OR
component {
this.name = "ORMTest";
this.ORMEnabled = true;

this.ormsettings = {
dbcreate : "update",
dialect : "MicrosoftSQLServer"
}
}
```

i.e.<code>&lt;cfapplication&gt;</code>

```lucee
<cfapplication name="ORMTest" datasource="ORM" ormEnabled="true" ormSettings=#{dbcreate="update",dialect="MicrosoftSQLServer"}# >
```

Key | Description | default
-------------- | ----------------- | -----------------
autogenmap | **(default:true; autogenmap=false is not supported yet.)** Specifies whether Lucee should automatically generate mapping for the persistent CFCs. If autogenmap=false, mapping should be provided in the form of "{cfc-name}.cfc.hbm.xml" files. | true
autoManageSession | **(default:true; not supported yet).** Lets you specify if Lucee must manage Hibernate session automatically. If enabled: Lucee manages the session completely. That is, it decides when to flush the session, when to clear the session, and when to close the session. If disabled: The application is responsible for managing flushing, clearing, or closing of the session. The only exception is (in the case of transaction), when the transaction commits, the application flushes the session. Lucee closes the ORM session at the end of request irrespective of this flag being enabled or disabled. | true
cacheConfig | Specifies the location of the configuration file that should be used by the secondary cache provider.This setting is used only when secondarycacheenabled=true. | |
cacheProvide | Specifies the cache provider that should be used by ORM as secondary cache. | |
catalog | Specifies the default Catalog that should be used by ORM. | |
cfclocation | Specifies the directory (or array of directories) that should be used by Lucee to search for persistent CFCs to generate the mapping. If cfclocation is set, Lucee looks at only the paths specified in it. If it is not set, Lucee looks at the application directory, its sub-directories, and its mapped directories to search for persistent CFCs. | |
datasource | Specifies the data source that should be used by ORM. If it is not specified here, then the data source specified for the application is picked up. | |
dbcreate | Hibernate can automatically create the tables for your application in the database. dbCreate takes the following values: <ul><li> **update:** Setting this value creates the table if it does not exist or update the table if it exists.</li><li> **dropcreate:** Setting this value drops the table if it exists and then creates it.</li><li> **none:** Setting this value does not change anything in the database schema.</li></ul> | none
dialect | Specifies the dialect.Lucee supports the following dialects: [Cache 2007.1, Cache71, Cache 2007.1, DB2, DB2/390, DB2/400, DB2390, DB2400, DB2AS400, DB2OS390, DataDirectOracle9, Derby, Firebird, FrontBase, H2, H2DB, HSQL, HSQLDB, Informix, Ingres, Interbase, JDataStore, MSSQL, Mckoi, MckoiSQL, MicrosoftSQLServer, Mimer, MimerSQL, MySQL, MySQL/InnoDB, MySQL/MyISAM, MySQL5, MySQL5/InnoDB, MySQL5InnoDB, MySQLInnoDB, MySQLMyISAM, MySQLwithInnoDB, MySQLwithMyISAM, Oracle, Oracle10g, Oracle8i, Oracle9, Oracle9i, Pointbase, PostgreSQL, PostgresPlus, Progress, SAPDB, SQLServer, Sybase, Sybase11, SybaseASE15, SybaseAnywhere, com.ddtek.jdbc.db2.DB2Driver, com.microsoft.jdbc.sqlserver.SQLServerDriver, oracle.jdbc.driver.OracleDriver, org.firebirdsql.jdbc.FBDriver, org.gjt.mm.mysql.Driver, org.h2.Driver, org.hsqldb.jdbcDriver, org.postgresql.Driver] | |
eventHandling | Specifies whether ORM Event callbacks should be given. | false
flushAtRequestEnd | Specifies whether ormflush should be called automatically at request end. If flushatrequestend is false, ormflush is not called automatically at request end. | true
logSQL | Specifies whether the SQL queries that are executed by ORM will be logged. If LogSQL=true, the SQL queries are logged to the console. | false
ormConfig | The Hibernate configuration file. This file contains various configuration parameters like, dialect, cache settings, and mapping files that are required for the application. For more details, see <http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html>. The settings defined in the ormsettings override the settings defined in the Hibernate Configuration XML file.The connection information in the Hibernate Configuration XML file is however ignored because Lucee uses its own connection pool. You will need to use this only when you need to use a hibernate setting that is not available using ormsetting. | |
saveMapping | Specifies whether the generated Hibernate mapping file has to be saved to disc. If you set the value to true, the Hibernate mapping XML file is saved with the filename "CFC name".hbm.xml in the same directory as the CFC. If any value of savemapping is specified in CFC, it will override the value specified in the ormsetting. | false |
schema | Specifies the default Schema that should be used by ORM. | false |
secondaryCacheEnabled | Specifies whether secondary caching should be enabled | false |
skipCFCWithError | **(default:false;not implemented yet)** Lets you specify if Lucee must skip the CFCs that have errors. If set to true, Lucee ignores the CFCs that have errors. | false |
sqlscript | Path to the SQL script file that gets executed after ORM is initialized. This applies if dbcreate is set to dropcreate. This must be the absolute file path or the path relative to the application.The SQL script file lets you populate the tables before the application is accessed.
useDBForMapping | Specifies whether the database has to be inspected to identify the missing information required to generate the Hibernate mapping. The database is inspected to get the column data type, primary key and foreign key information. | true
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ id: extensions-extension-provider

Extensions are provided by the Extension Provider. An Extension Provider is a webservice that obeys a certain interface described below. Extension Provider can easily be registered in the Lucee Administrator. All you have to do is to enter and save the URL address pointing to it.

Lets have a look at the interface of the extension providers. As already said it is a webservice that can be programmed in any given technology. In our examples we are using a CFC (CF Component).
Let's have a look at the interface of the extension providers. As already said it is a webservice that can be programmed in any given technology. In our examples we are using a CFC (CF Component).

### Interface ###

Expand All @@ -26,9 +26,7 @@ title | Title of the extension provider
description | Description of the extension provider
image | Link to an image
url | URL for more information
mode | Defines how the Information of the ExtensionProvider is cached in the client (Lucee Administrator). Valid values are:
<ul><li>develop - does not cache the result of the extension provider</li>
<li>production (or no value) - caches the result in the session scope of the consumer</li></ul>
mode | Defines how the Information of the ExtensionProvider is cached in the client (Lucee Administrator). Valid values are: <ul><li>develop - does not cache the result of the extension provider</li><li>production (or no value) - caches the result in the session scope of the consumer</li></ul>

### listApplications ###

Expand Down