/* $Id: TableBuilder.cs,v 1.5 2004/11/01 14:36:33 larsbm Exp $
* Copyright (c) 2004 Engine EAR GmbH & Co. KG
* Developed by: Lars Behrmann, lb@engine.de
*/
using System;
using System.Data;
namespace SQLToNeo.Model{
/// <summary>
/// Zusammenfassung fr TableBuilder.
/// </summary>
public class TableBuilder
{
public static DataTable GetTableXML()
{
DataTable dt = new DataTable("xml");
DataColumn dc = dt.Columns.Add("id", typeof(Int32));
dc.AllowDBNull = false;
dc.Unique = true;
dc.AutoIncrement = true;
dc.AutoIncrementSeed = 0;
dc.AutoIncrementStep = 1;
dc = dt.Columns.Add("norquedtd", typeof(String));
dc.DefaultValue = "norque.dtd";
dt.Columns.Add("neopath", typeof(String));
dt.Columns.Add("packagename", typeof(String));
dt.Columns.Add("neodbname", typeof(String));
dt.Columns.Add("modelpathfile", typeof(String));
dc = dt.Columns.Add("idmethod", typeof(String));
dc.DefaultValue = "guid";
dc = dt.Columns.Add("tablePrefix", typeof(String));
dc.DefaultValue = "";
dc = dt.Columns.Add("javaNamingMethod", typeof(String));
dc.DefaultValue = "nochange";
dt.PrimaryKey = new DataColumn[] {dt.Columns["id"]};
return dt;
}
public static DataTable GetTableForeignKeys(string tablename)
{
DataTable dt = new DataTable(tablename);
DataColumn dc = dt.Columns.Add("id", typeof(Int32));
dc.AllowDBNull = false;
dc.Unique = true;
dc.AutoIncrement = true;
dc.AutoIncrementSeed = 0;
dc.AutoIncrementStep = 1;
dt.Columns.Add("tableid", typeof(Int32));
dt.Columns.Add("foreigntable", typeof(String));
dt.Columns.Add("name", typeof(String));
dt.Columns.Add("local", typeof(String));
dt.Columns.Add("foreign", typeof(String));
dc = dt.Columns.Add("onUpdate", typeof(String));
dc.DefaultValue = "none";
dc = dt.Columns.Add("onDelete", typeof(String));
dc.DefaultValue = "none";
//dt.Columns.Add("onUpdate", typeof(String));
//dt.Columns.Add("onDelete", typeof(String));
dc = dt.Columns.Add("create", typeof(Boolean));
dc.DefaultValue = true;
dt.PrimaryKey = new DataColumn[] {dt.Columns["id"]};
return dt;
}
public static DataTable GetTableTable()
{
DataTable dt = new DataTable("table");
DataColumn dc = dt.Columns.Add("id", typeof(Int32));
dc.AllowDBNull = false;
dc.Unique = true;
dc.AutoIncrement = true;
dc.AutoIncrementSeed = 0;
dc.AutoIncrementStep = 1;
dt.Columns.Add("name", typeof(String));
dt.Columns.Add("javaName", typeof(String));
dc = dt.Columns.Add("defaultProperty", typeof(String));
dc.DefaultValue = "";
dc = dt.Columns.Add("idMethod", typeof(String));
dc.DefaultValue = "null";
dc = dt.Columns.Add("manyToMany", typeof(Boolean));
dc.DefaultValue = false;
dc = dt.Columns.Add("create", typeof(Boolean));
dc.DefaultValue = true;
dt.PrimaryKey = new DataColumn[] {dt.Columns["id"]};
return dt;
}
public static DataTable GetTableColumns()
{
DataTable dt = new DataTable("column");
DataColumn dc = dt.Columns.Add("id", typeof(Int32));
dc.AllowDBNull = false;
dc.Unique = true;
dc.AutoIncrement = true;
dc.AutoIncrementSeed = 0;
dc.AutoIncrementStep = 1;
dt.Columns.Add("tableid", typeof(Int32));
dt.Columns.Add("javaName", typeof(String));
dt.Columns.Add("name", typeof(String));
dt.Columns.Add("type", typeof(String));
dt.Columns.Add("size", typeof(Int32));
dt.Columns.Add("required", typeof(Boolean));
dc = dt.Columns.Add("hidden", typeof(Boolean));
dc.DefaultValue = false;
dt.Columns.Add("primaryKey", typeof(Boolean));
dc = dt.Columns.Add("create", typeof(Boolean));
dc.DefaultValue = true;
dc = dt.Columns.Add("identity", typeof(Boolean));
dc.DefaultValue = false;
dt.PrimaryKey = new DataColumn[] {dt.Columns["id"]};
return dt;
}
}
}
/*
* $Log: TableBuilder.cs,v $
* Revision 1.5 2004/11/01 14:36:33 larsbm
* - Finished NeoXmlModelWriter
* - Fixed bugs in TableStyleCreator and TableBuilder
* - Implement new RestrictionChecker and additional test cases
*
* Revision 1.4 2004/10/26 13:23:45 larsbm
* - Fixed bugs in tablebuilder
* - Working on the forms
* - Finishing MergeSpecial
* - Make app run with mergespecial
* - start converter for sqldatatypes
*
*
*/
|