Some of the things you might wish to do with Melati.
id
id
field as the foreign key into referenced tabletable
column
type
setting
user
group
capability
membership
capability
org.melati.LogicalDatabase.properties
file.
http://127.0.0.1:8081/Admin/<yourdbname>/Main
http://127.0.0.1:8081/Admin/<yourdbname>/DSD?comments=true
org.yourorg.yourproject.model
)
org.yourorg.yourproject.model
)
instead of org.melati.poem
org.melati.poem.PoemDatabase
, from which
all POEM databases inherit, this DSD will include the system tables
Table
Column
Table type
Setting
User
Group
Capability
Group Membership
Group Capability
cd <model directory> java -cp c:\melati\src\main;c:\melati\target\melati.jar org.melati.poem.prepro.DSD <yourproject>.dsd
generated
,
the files you should elaborate are in your model directory.
org.melati.LogicalDatabase.properties
file
to reflect the new class name of your database.
In your DSD extend the TableInfo
and/or ColumnInfo
tables.
For example to add a FileNumber
to every table and a FieldNumber
to every column:
// =========================== // Extend Poem metadata tables // =========================== table TableInfo extends org.melati.poem.TableInfo (displayorder = 3010) { Integer fileNumber (displayname = "File Number") (description = "My File Number") (nullable) ; } table ColumnInfo extends org.melati.poem.ColumnInfo (displayorder = 3020) { Integer fieldNumber (displayname = "Field Number") (description = "My Field Number") (nullable) ; }
Note that you need to specify the displayorder
or the table will be given a sequential
displayorder
.
You will need to add something like the following to your generated files
TableInfo
public TableInfo(Table table) { org.melati.poem.TableInfo poemTableInfo = new org.melati.poem.TableInfo(table); setName_unsafe(poemTableInfo.getName()); setDisplayname_unsafe(poemTableInfo.getDisplayname()); setDisplayorder_unsafe(poemTableInfo.getDisplayorder()); setDescription_unsafe(poemTableInfo.getDescription()); setCachelimit_unsafe(poemTableInfo.getCachelimit()); setSeqcached_unsafe(poemTableInfo.getSeqcached()); setCategory_unsafe(poemTableInfo.getCategory_unsafe()); }
TableInfoTable
protected org.melati.poem.TableInfo defaultTableInfoFor(Table table) { return new TableInfo(table); }
Melati needs an Integer representation of a table's primary key.
If you have a suitable candidate but its name is not id
but intkey
then
subclass your chosen dbms
class, such as SQLServer and provide a pair of methods:
public String melatiName(String name) { if (name.equalsIgnoreCase("intkey")) return "id"; return super.melatiName(name); } public String unreservedName(String name) { if (name.equalsIgnoreCase("id")) return "intkey"; return super.unreservedName(name); }
org.melati.LogicalDatabase.properties
file to select the
MSAccess
DbmsClass
build
directory type
ant go