public string FormatEntity(DocEntity docEntity, Dictionary<string, DocObject> map, Dictionary<DocObject, bool> included)
{
StringBuilder sb = new StringBuilder();
sb.Append("CREATE TABLE ");
sb.Append(docEntity.Name);
sb.Append(" (oid INTEGER");
BuildFields(sb, docEntity, map);
sb.Append(");");
sb.AppendLine();
foreach (DocAttribute docAttr in docEntity.Attributes)
{
if (docAttr.GetAggregation() != DocAggregationEnum.NONE && docAttr.Inverse == null)
{
sb.AppendLine();
sb.Append("CREATE TABLE ");
sb.Append(docEntity.Name);
sb.Append("_");
sb.Append(docAttr.Name);
sb.Append(" (source INTEGER, sequence INTEGER, target INTEGER);");
}
}
return sb.ToString();
}