AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Cleanup table names and column names doesn't work #292

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have an old database with some bizarre naming rules, but all of the
tables/columns respect them. i.e. each table starts with T_XY where X and Y
are two specific letters. All the columns are starting with those letters
and are ending with some suffix describing its type e.g. XYNameTx_N

2. I have defined this rule on the Cleanup property of the DBML but it
doesn't seem to be applied at all
^\\w+_,^T_..,^..,B_N$,Bl$,Tx_N$,Tx$,Mn$,Mn_N$,In$,In_N$,Fl$,Fl_N$,_N$,

What did I do wrong?

Both entities.cs, entity names and manager names are like in the db!

What is the expected output? What do you see instead?
Entities with names without T_XY and Columns without prefix & suffix.

What version of the product are you using?
4.0 / 5.2

Please provide any additional information below.
http://screencast.com/t/MzkxMDgwNDAt

Original issue reported on code.google.com by alonec...@gmail.com on 27 Feb 2010 at 1:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Try rewriting the first token:

^\\w+_

as:

^[A-Za-z0-9]+_

Original comment by mikromak on 1 Mar 2010 at 7:12

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 2 Mar 2010 at 5:04

GoogleCodeExporter commented 9 years ago
ERROR: C:\Temp\abc\abc.csp(0,0) Value cannot be null.
Parameter name: propertyName
Stack Trace:
   at LinqToSqlShared.Generator.CommonUtility.GetFieldName(String propertyName)
   at LinqToSqlShared.Generator.DbmlGenerator.PopulateColumn(Column column,
DataObjectBase columnSchema, String className)
   at LinqToSqlShared.Generator.DbmlGenerator.CreateColumns(Table table, TableSchema
tableSchema)
   at LinqToSqlShared.Generator.DbmlGenerator.GetTable(TableSchema tableSchema,
Boolean processAssociations)
   at LinqToSqlShared.Generator.DbmlGenerator.Create(DatabaseSchema databaseSchema)
   at _CodeSmith.Dbml_cst.Generate() in
c:\Temp\abc\Templates\LinqToSql\CSharp\Dbml.cst:line 157
   at _CodeSmith.Dbml_cst.__RenderMethod1(TextWriter writer, Control control) in
c:\Temp\abc\Templates\LinqToSql\CSharp\Dbml.cst:line 213
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject csp)
Unable to render output DBML, skipping...

Original comment by alonec...@gmail.com on 4 Mar 2010 at 6:23

GoogleCodeExporter commented 9 years ago
Can you provide a sample schema so we can reproduce this error?

Original comment by shannon....@gmail.com on 5 Mar 2010 at 5:09