Index Meta Data

Posts   
 
    
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 12-Jan-2005 19:55:58   

I was looking around in the llblgen project that shows up in the template studio.

I was looking for meta data relating to indexes that are on tables.

I was considering creating a set of templates that could be used to provide sort clauses for entities that make use of various indexes.

Is the index data avaialble in the LLBLGen project? If not, it would be REALLY cool to have access to that. (Or you could add it as a feature of your next release of llblgen pro) even better.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39738
Joined: 17-Aug-2003
# Posted on: 12-Jan-2005 20:59:55   

Index data is not available in the projects, as it is not read from catalogs. Not all databases offer meta-data on indexes defined, it's therefore not always possible to read that data. Also, indexes are considered part of the live, running db, not part of the db schema.

It is on the todo, but I'm not sure when it will be added. The schema retrieval of large(r) databases already can take some time and by adding more data to be read it isn't going to get any faster wink ).

Frans Bouma | Lead developer LLBLGen Pro
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 23-Feb-2009 17:37:14   

I know this is an old thread and things may have changed.

I'm working on creating LPT Templates (vb) to generate my BL Managers. Most of it's done but I would like to generate fetch routines for each Index field in the table. Is it now possible to get that infomation so I can generate the proper code?

If not, is there another way of doing what I want to accomplish?

Thanks,

FIshy

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39738
Joined: 17-Aug-2003
# Posted on: 24-Feb-2009 10:53:51   

Fishy wrote:

I know this is an old thread and things may have changed.

I'm working on creating LPT Templates (vb) to generate my BL Managers. Most of it's done but I would like to generate fetch routines for each Index field in the table. Is it now possible to get that infomation so I can generate the proper code?

If not, is there another way of doing what I want to accomplish?

Thanks,

FIshy

Indexes aren't available in the meta-data. Unique constraints, FK constraints are. It's likely the FK side of FK constraints are index candidates and you then would miss a few perhaps, but not many.

The main thing is that index meta-data isn't really helping: if data pressure changes, indexes will move/change, but the model/code won't.

Frans Bouma | Lead developer LLBLGen Pro
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 24-Feb-2009 17:33:51   

Could I add a Custom Property to the a mapped entity field and then in my .lpt file check that property and generate the appropriate code?

If so, could you you include a lpt (vb) snippet that would check a custom property?

Thank you for all you help,

Fishy

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39738
Joined: 17-Aug-2003
# Posted on: 24-Feb-2009 17:36:50   

Fishy wrote:

Could I add a Custom Property to the a mapped entity field and then in my .lpt file check that property and generate the appropriate code?

If so, could you you include a lpt (vb) snippet that would check a custom property?

Thank you for all you help,

Fishy

You could always add a custom property and based on the value (or presence) do things in a template. Either use TDL (with the if statement to check on a string value) or loop through an entity's CustomProperties collection. It's a hashtable (EntityDefinition.CustomProperties) with name-value pairs, both strings.

Frans Bouma | Lead developer LLBLGen Pro
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 24-Feb-2009 18:21:12   

You are the man! simple_smile

Your code generator rocks! stuck_out_tongue_winking_eye

Thanks for all your help,

Fishy sunglasses