Print Page | Close Window

Is there an API that will let me get the physical database table name from an EntityColumn

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=203
Printed Date: 16-Oct-2025 at 11:09am


Topic: Is there an API that will let me get the physical database table name from an EntityColumn
Posted By: Customer
Subject: Is there an API that will let me get the physical database table name from an EntityColumn
Date Posted: 12-Jul-2007 at 3:35pm
We have a new issue now. Our ID generation process uses EntityTypeInfo.GetPrototypeTable(EntityColumn.EntityType).TableName, the result of which is passed as a parameter to the stored procedure which generates the next ID for that table. It seems that this API has changed in the latest IdeaBlade version, and it's breaking our app. We used to get "REQ_TEMP_ACK," the actual name of the physical database table, from this function and we now get "Broadlane:GPOiEntities:TempAck" which seems to be the fully-qualified class name of the entity. Now I would just update these table names in the database, but we still have clients using the previous IdeaBlade version, so that's a non-starter.

Is there something in the API that will let me get the physical database table name from an EntityColumn?




Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 3:36pm

Try this:

/// via a given PersistenceManager.</summary>

/// <param name="pRdbEntityType">RdbEntityType whose name may be different

/// than the corresponding SQL table name.</param>

/// <param name="pManager">The PersistenceManager which is our gateway to

/// the concrete database datasource.</param>

/// <remarks>

/// Includes table owner name, formatted per the applicable SQL provider, e.g.

/// orderInfo.GetSqlTableName returns "dbo"."MachineSummary".

/// </remarks>

public static string GetSqlTableName(Type pRdbEntityType, PersistenceManager pManager) {

RdbKey key = (RdbKey) pManager.DataSourceResolver.GetDataSourceKey(pRdbEntityType);

RdbQuerySqlFormatter formatter = new RdbQuerySqlFormatter(key.AdoHelper);

return formatter.QualifyTableName(pRdbEntityType);

}

 




Print Page | Close Window