Changes for page Best Practices-Model

Last modified by Theodore Petrosky on 2014/02/20 18:51

From version 29.1
edited by arroz
on 2007/12/20 11:52
Change comment: There is no comment for this version
To version 32.1
edited by arroz
on 2008/02/03 17:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -29,6 +29,27 @@
29 29  * Create slight variations to the defined mapping in a given attribute.
30 30  * Change DB easily without touching your models.
31 31  
32 +Let's look at an example for a prototype. This is the definition of "shortString", a prototype defined in the WONDER's ERPrototypes framework (we'll talk more about this framework later). The screenshot was taken from the Entity Modeler plugin in Eclipse, part of WOLips.
33 +
34 +[[image:prototypeExample.png]]
35 +
36 +We can see here that:
37 +
38 +* The prototype name is "shortString".
39 +* The external type (ie, the database type) is varchar.
40 +* The varchar width is 50, which means you can save up to 50 characters on each record.
41 +* The Java class that will map the database value in memory is String.
42 +
43 +(The other fields are not relevant for the prototype definition)
44 +
45 +You can create your own prototype definitions, or use WONDER's.
46 +
47 +To create your own prototypes, you need to create a special entity in a model file called ##EOJDBCPrototypes##. It's recommended that you create a new model file with just the prototype entity, and place that file in a new, empty framework. This way you can share the same prototypes with all of your projects, and you may switch between prototype frameworks to use different databases without making any modification on your application.
48 +
49 +WONDER prototype framework, ERPrototypes, has different prototype entities, one for each database. The one for Postgresql framework is called ##EOJDBCPostgresqlPrototypes## and so on. To use those prototypes, just link your project with ERPrototypes after installing WONDER. Then, on your model database configuration, choose the right prototype in the appropriate menu:
50 +
51 +[[image:prototypeSelection.png]]
52 +
32 32  eogenerator
33 33  
34 34  to-many relationships