L.S.
I am new to mmbase and am assigned the task to disclose existing
information from a MySQL-database to the web using mmbase. Tables are
related using foreign keys and the database is normalized. Since the
database is also used for another application, I have little freedom to
adjust the database structure. The primary keys are mainly of type
VARCHAR and sometimes they are composed of multiple VARCHAR fields.
I have just created my first two builders A and B, both existing
database tables have a single field VARCHAR primary key. When I run
mmbase, it says that the fields otype, number and owner are not present
in the database table and therefore treated as virtual. I now try to
model that A contains a field that is a foreign key to B. I guess I have
to use the NODE-type for that. However, since the relationship is over a
VARCHAR-field, I have no idea how to accomplish that. Below is a snippet
of A's builder file, describing the relationship, but as is, this is
(obviously) not working out. What do I have to do to make this work?
<field>
<descriptions>
<description xml:lang="nl">publicatietype</description>
</descriptions>
....
<datatype base="string" xmlns="http://www.mmbase.org/xmlns/datatypes">
<pattern value="\A{1}" />
</datatype>
<db>
<name>PUBLICATIE TYPE</name>
<type state="persistent" size="1" notnull="true"
key="false">NODE</type>
</db>
</field>
Thanks in advance and best regards,
Dave
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers