New Posts New Posts RSS Feed: Is there an API that will let me get the physical database table name from an EntityColumn
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

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

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Is there an API that will let me get the physical database table name from an EntityColumn
    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?

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post 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);

}

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down