This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, when trying to retrieve list of entities I am getting {"Unable to materialize field [SessionKey] on type [DataModel.RiskItem]. Check your table has an Id column and that your mappings are correct. See inner exception for details. "} Inner exception looks following:
Stack Trace:
at Mindscape.LightSpeed.Model.FieldModel.<>cDisplayClass7b. Mechanism that retrieves the data (one that fails) looks:
My mapping looks following:
My database table looks like this:
Any help would be appreciated. Thanks. |
|
|
Your database table has no Id column which is most likely what is generating the error. You will either need to add an Id column or set a column name for the Id property to be SessionKey (if that is the PK) and then remove the SessionKey property from the entity (as it will be loaded into the Id property).
|
|
|
Hi Jeremy., thanks for response,
SessionKey is primary key you can see this from sql script. < entity name="RiskItem" identityType="String" cached="true" cacheExpiry="0" tableName="RiskItems" identityColumnName="SessionKey" schema="ActuarialPricing"> SessionKey is defined in xml as primary key. Changing table is out of question. I need SessionKey to be a property on entity while remaining to be PrimaryKey on table, could you show me how do I need to modify XML to achieve this. Thanks. |
|