AnantLabs / codesmith

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

Bug: Cleaning expression is applied twice on MTM #354

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. All my tables in an old database are named like T_XYNameA, T_ZWNameB etc.
2. All the columns are named like XYColumn1, XYColumn2 for the first table
and ZWColumn1, ZWColumn2 etc. for the #2nd table. Therefore the first two
letters are always the same for all the columns of the same table.
3. All the columns are suffixed by their type i.e. XYNameTx,
XYDescriptionTx_N, XYTotalMn_N etc.
4. My cleanup expression is like this:
<property name="CleanExpression">
        <stringList>
          <string>^(sp|tbl|udf|vw)_</string>
          <string>^T_..</string>

<string>(Tx$|Tx_N$|Mn_N$|Mn$|Bl_N$|Bl$|In_N$|In$|Fl_N$|Fl$|_N$|^..)</string>
        </stringList>
      </property>
Therefore for a column like XYDescriptionTx_N I expect a property called
Description.
So far so good, but:
5. Notice the ^.. rule at the end.

What is the expected output? What do you see instead?
If I have three tables T_SIStockItem, T_MaManufacturer and T_SuSupplier

When a Many-To-Many property is generated, the ^.. rule is applied twice,
therefore instead of having ManufacturerSupplier property I have
NufacturerSupplier :(
Other examples in the other tables: NufacturerStockItems, 

This is a very nasty bug. Please fix it.

What version of the product are you using?
PLINQO 4.0.1 / CodeSmith 5.2 - latest

Please provide any additional information below.

Original issue reported on code.google.com by alonec...@gmail.com on 3 May 2010 at 8:07

GoogleCodeExporter commented 9 years ago
I have fixed this on my own - but I can't test all the other cases, nor I can 
see
implemented unit tests to add my test to the suite.
Therefore please some one from PLINQO test it as well.

It works for my case, for both with and without column cleaning expressions.

Original comment by alonec...@gmail.com on 3 May 2010 at 8:35

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 4 May 2010 at 3:32