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
|
I have entity class generated by designer. In partial class of that class i add property MyProperty. If that property does have private backing field (_myProperty) all works fine. If i add private backing field following exception throws: ORA-00904: "EntityName"."MYPROPERTY": invalid identifier see attachment |
|
|
When LightSpeed queries the database to load an entity, it asks for all fields. This includes fields in the partial class. (At runtime, LightSpeed doesn't know whether fields were defined in the .lsmodel file or in the partial class.) In your case, therefore, LightSpeed asks the database for a MYPROPERTY column from which it plans to load the _myProperty field. That column doesn't exist so you get the database exception. Entity fields which don't map to database columns, like _myProperty, must be marked with the [Transient] attribute. This excludes them from all database queries and save operations. |
|
|
[Transient] attribute solves my problem, but it would be nice if we could set attribute to fields those are database table fields (i. e. TableFieldAttribute) and must not set any attributes to the rest of fields. This behavior - reduces user code and increases designer generated code - saves user if he forget to set [Transient] attribute (designer cannot forget to set TableFieldAttribute) it is not critical wish |
|
|
such behaviur can take force if entity class marked with
[ System.CodeDom.Compiler.GeneratedCode("LightSpeedModelGenerator", "1.0.0.0")]attribute |
|