Exemple #1
0
        private string GenDao(TableInfo table)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("table", table);
            dic.Add("daopackage", ConstHelper.DaoPackage);
            dic.Add("popackage", ConstHelper.PoPackage);
            dic.Add("GenHelper", genHelper);

            foreach (var column in table.Columns)
            {
                if (column.IsPrimaryKeys)
                {
                    genHelper.hasPrimaryKey        = true;
                    genHelper.getGeneratedKeyField = column.Name;
                    dic.Add("KeyJavaType", column.JavaType);
                    dic.Add("KeyField", genHelper.GetField(column.Name));
                }
            }


            return(nVelocityHelper.GenByTemplate("mdt.dao.java.vm", dic));
        }