100 likes | 316 Views
J- oy. Plugins : Tables2Entities. Goal. Generate Entities model from Database Model. Input – Reverse- engineered data model. Output – Entities model. Output – JoyEntity Classes. A class is generated for each table. Classes have following stereotype: JOYEntity
E N D
J-oy Plugins: Tables2Entities
Goal. Generate Entities model from Database Model.
Output – JoyEntityClasses • A class is generated for each table. • Classes have following stereotype: JOYEntity • Classes have following tagged values: • JoyTable: Databasetablename • Forinstance: CUSTOMER • JoyLabel: Key of thelabelfordisplayingmenus and CRUD page titles. • Forinstance: “entity.label.Customer” • JoyRoles.Create: required roles forcreatinginstances of theentity. • Forinstance: * (forallusers) or “JAAS_ADMIN,JAAS_CUST_ADMIN” (for a specific role o set of authorized roles) • JoyRoles.Read: required roles forreadinginformationaboutinstances of theentity. • JoyRoles.Edit : required roles foreditinginstances of theentity. • JoyRoles.Delete : required roles fordeletinginstances of theentity.
Output – JoyEntityAttributes • Attributes have following datamodel-related tagged values: • JoyColumn: Name of thecorrespondingcolumn in thetable. • JoyPK: “true” iscorrespondingcolumnispart of theprimarykey of thetable. • JoyDbType: Datatype of thecorrespondingcolumn in thetable. • JoyLength: Length of thecorrespondingcolumn in thetable (forstrings). • JoyPrecision: Precision of thecorrespondingcolumn in thetable (fornumbers). • JoyScale : Scale of thecorrespondingcolumn in thetable (fornumbers).
Output – JoyEntityAttributes • Attributes have following tagged values: • JoyDefaultValue: Default valuefortheattributewhen new instances of theentity are created. • JoyLabel.Detail: Labelforattribute in CRUD detailform. • Forinstance: “attribute.label.Name” • JoyLabel.Browse: Labelforattribute in searchresultslist. • JoyLabel.Tooltip: Labelfortooltiptextonthefield. • JoyLabel.Help: Labelforhelponthefield. • JoyVisible.Detail: “true” if visible in detailform. • JoyVisible.Browse: “true” if visible in searchresultslist. • JoyEditable.Detail: “true” iseditable in detailform. • JoyEditable.Browse: “true” iseditable in searchresultslist. • JoyIsFilter : “true” ifis a searchcondition in searchresultslist.
Output – JoyEntityAttributes • Attributes have following validation related tagged values: • JoyInput.ValuesDomain: List of possiblevalues of the combo. • Forinstance: 1=msg_key_one;2=msg_key_two • JoyInput.RegularExpression: Regular expressionforvalidating input values. • JoyInput.ValidationExpression: Expressionforvalidating input values. • Forinstance: Groovyexpressionforvalidating input. Syntaxisdependsoncodegenerationtemplateused. • JoyLower : Lowermultiplicity. • Forinstance: 0 foroptionalattributes, 1 formandatoryones. • JoyUpper: Uppermultiplicity. • Forinstance: 1 for input texts, n>1 formultipleselection combos, * forunlimitedpossiblevalues.
Output – JoyEntityAttributes • Attributes have following additional-actions tagged values: • JoyActions.Detail: Number of additionalactions in the CRUD form. • JoyActions.Detail.<n>.label: Messagekey of action <n>. • JoyActions.Detail.<n>.key: Id of theadditionalaction. • JoyActions.Detail.<n>.roles: Roles allowedtoexecutetheaction <n>. • <n> from 0 toJoyActions.Detail-1
Futherquestions • Ifyouwanttocontribute, haveanyquestionorsuggestion, pleasecontactus at: • info.joy.team@gmail.com