Changes for page The EOModel

Last modified by Pascal Robert on 2012/03/10 15:42

From version 17.1
edited by Pascal Robert
on 2012/03/10 08:46
Change comment: There is no comment for this version
To version 13.1
edited by Pascal Robert
on 2012/03/10 15:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -355,6 +355,44 @@
355 355  
356 356  == Connection Dictionary ==
357 357  
358 +In each EOModel, you can store one or many database configurations. A database configuration consists of the prototype selection for your database (MySQL, H2, etc.), the adaptor (99% of the time, it's JDBC), the URL (JDBC connection string), the username and password to connect to the datastore, the driver (JDBC driver name) and the name of the EOAdaptor plugin. You need to have at least one database configuration in your model so that you can use database migrations and reverse engineer a database to a model.
359 +
360 +When you launch your application, it will use the default database configuration from the model. An alternative to database configuration is to use properties in the Properties file to specify the connection dictionary. For example, for a H2 database, you can use a configuration like this:
361 +
362 +{{panel}}
363 +
364 +dbConnectUserGLOBAL=
365 +dbConnectPasswordGLOBAL=
366 +dbConnectURLGLOBAL = jdbc:h2:file:~/politimo
367 +dbConnectPluginGLOBAL = H2PlugIn
368 +
369 +{{/panel}}
370 +
371 +Using the **GLOBAL** properties will apply the properties to all models in your application (and to models in your frameworks). You can also specify propertiers per model, with those properties:
372 +
373 +{{panel}}
374 +
375 +\[WO:MODEL_NAME\].DBDriver
376 +\[WO:MODEL_NAME\].DBHostName
377 +\[WO:MODEL_NAME\].DBPassword
378 +\[WO:MODEL_NAME\].DBPlugin
379 +\[WO:MODEL_NAME\].DBURL
380 +\[WO:MODEL_NAME\].DBUser
381 +
382 +{{/panel}}
383 +
384 +So if your EOModel is called **Politimo**, the properties will be:
385 +
386 +{{panel}}
387 +
388 +Politimo.DBDriver =
389 +Politimo.DBPassword =
390 +Politimo.DBPlugin = H2PlugIn
391 +Politimo.DBURL = jdbc:h2:file:~/politimo
392 +Politimo.DBUser =
393 +
394 +{{/panel}}
395 +
358 358  == Runtime Selection of the Connection Dictionary and Prototypes ==
359 359  
360 360  == Debugging JDBC Connections and Jdbc2info ==