0
0
The code fragment above sets up the Hibernate settings for the application. The first line sets up the location of the Hibernate binaries; this value should be the same as the value of the HIBERNATE_BINARY_DIR setting in the JVM parameter file. The dialect should be set to the dialect of the database that the application is using; in this case, it is set to the SQLServer2008Dialect. The next setting is the dbcreate configuration property. This setting tells Hibernate how to create the database for the application. The only valid value for this property is "update". The next two lines disable the secondary cache and specify the ehCache cache provider. The last two lines specify the log SQL and event handling settings. The log SQL setting tells Hibernate to log all SQL statements that are executed by the application. The event handling setting tells Hibernate to run the cborm.models.EventHandler class when any events occur. The last line enables the Hibernate ORM session management settings. The flushAtRequestEnd setting tells Hibernate to flush the session at the end of each request. The autoManageSession setting tells
// ORM SETTINGS
this.ormEnabled = true;
this.ormSettings = {
// ENTITY LOCATIONS, ADD MORE LOCATIONS AS YOU SEE FIT
cfclocation = [ expandPath( "./" ) ],
// THE DIALECT OF YOUR DATABASE OR LET HIBERNATE FIGURE IT OUT, UP TO YOU TO CONFIGURE
dialect = "org.hibernate.dialect.SQLServer2008Dialect",
// DO NOT REMOVE THE FOLLOWING LINE OR AUTO-UPDATES MIGHT FAIL.
dbcreate = "update",
// FILL OUT : IF YOU WANT CHANGE SECONDARY CACHE, PLEASE UPDATE HERE
secondarycacheenabled = false,
cacheprovider = "ehCache",
cacheconfig = expandPath( "./config/ehcache.xml" ),
logSQL = false,
// ORM SESSION MANAGEMENT SETTINGS, DO NOT CHANGE
flushAtRequestEnd = false,
autoManageSession = false,
// ORM EVENTS MUST BE TURNED ON FOR CBORM TO WORK
// eventHandling = true,
// eventHandler = "cborm.models.EventHandler",
// Hibernate generated objects settings
savemapping = false,
autogenmap = true,
// THIS IS ADDED FOR COLDBOX SO THAT THE OTHER CFML ENGINE FILES DON'T ERROR OUT
skipCFCWithError = true
};