Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Entity Field Name Strip Pattern
 

Pages: 1
LLBLGen Pro Runtime Framework
Entity Field Name Strip Pattern
Page:1/1 

  Print all messages in this thread  
Poster Message
TopDog74
User



Location:
UK
Joined on:
27-Apr-2012 13:04:36
Posted:
40 posts
# Posted on: 04-Dec-2015 18:02:48.  
Hi,

I have many Entities with audit fields all named like:

***_UpdatedOn
***_UpdatedBy

For example a client entity has

Cli_UpdatedOn
Cli_UpdatedBy

and a PersonEntity has

Per_UpdatedOn
Per_UpdatedBy

I would like to give all these fields consistent names i.e.

UpdatedOn
UpdatedBy

Could you suggest if this is possible using the Entity Field Name Strip Pattern or some other project setting, and if yes, how i would go about doing it.

Thanks,
Iain
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8148 posts
# Posted on: 04-Dec-2015 23:27:05.  
Hi Ian,

You can use entity field strip pattern (Project -> Settings -> Element Name Construction). In this case, the entity field name strip patter could be:
Code:
{cli_, per_}{}




David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
TopDog74
User



Location:
UK
Joined on:
27-Apr-2012 13:04:36
Posted:
40 posts
# Posted on: 08-Dec-2015 10:10:19.  
Hi,

Thanks for getting back so quickly.

I wasn't clear enough in my question. i have hundreds of entities with random 3 character prefixes on all the column names.

Really what i'd like to achieve is for a way for the project to recognize the suffix and keep it, and strip the prefix.

For example

Per_Updatedby -> UpdatedBy
Cli_UpdatedBy -> UpdatedBy
Xxx_UpdatedBy -> UpdatedBy

etc. etc.

No worries if it's not possible i have a workaround in the code at them moment.

The reason i ask is that i have code in my entity generation template which auto sets these values. It would be nice if could just look for Fields.GetFieldNames().Contains("UpdatedBy") and then if found set the current value.

Cheers,
Iain


  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14637 posts
# Posted on: 08-Dec-2015 21:39:19.  
So you need wild card stripping.
Something like: {*_}{}

That's not supported at the moment.


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38081 posts
# Posted on: 09-Dec-2015 10:35:58.  
Good suggestion, we'll look into adding this in a future version.

To get these names renamed quicky, you could use a piece of code in Element Search. it's a bit cumbersome perhaps, but it's less work than renaming them by hand Wink. If you need help with that, let me know.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38081 posts
# Posted on: 16-Jan-2020 14:43:21.  
Implemented in v5.7

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.